Jump to content

Error with new transport


Welele

Recommended Posts

Hi

 

I obtain this error when try to save a new transporter

 

Notice en línea 78 en archivo /var/www/vhosts/vivirfelices.com/httpdocs/classes/ImageManager.php [8] Trying to access array offset on value of type bool Notice en línea 79 en archivo /var/www/vhosts/vivirfelices.com/httpdocs/classes/ImageManager.php [8] Trying to access array offset on value of type bool

 

 

Any idea?

error-transpor.jpg

Link to comment
Share on other sites

  • 4 weeks later...

This usually occurs when you're trying to access an array element that doesn't exist, and PHP returns a boolean value (false) instead.

To resolve this issue, you can try the following steps:

1. Make a backup of the affected file: Before making any changes, it's always a good idea to create a backup of the file you're going to modify. In this case, create a backup of the ImageManager.php file located at /var/www/vhosts/vivirfelices.com/httpdocs/classes/.

2. Modify the code: Open the ImageManager.php file with a text editor and locate the lines mentioned in the error messages (lines 78 and 79). The code may look something like this:

$width = $infos[0];
$height = $infos[1];

To fix the issue, you can add a conditional check to ensure the $infos variable is an array before trying to access its elements. Update the code like this:

$width = isset($infos[0]) ? $infos[0] : 0;
$height = isset($infos[1]) ? $infos[1] : 0;

This way, if $infos is a boolean value, the code will not try to access its elements and will instead assign a default value of 0 to $width and $height.

3. Save the changes and upload the modified file: Save the changes you made to ImageManager.php and upload it back to the /var/www/vhosts/vivirfelices.com/httpdocs/classes/ directory, replacing the original file.

4. Test your Prestashop store: After making these changes, try to save a new transporter again and see if the issue is resolved.

Please note that modifying the core files of your Prestashop installation is not recommended, as it can lead to compatibility issues when updating the software. If the issue persists, consider reaching out to Prestashop support or the community forums for assistance.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...