Jump to content

Why doesn't this product image module work?


Recommended Posts

I found this module for changing the background color of generated product images, but when I try to upload it, I get the general error: "Cannot Install module imagefill. The module is invalid and cannot be loaded."

Can someone take a look at the code for this module, and get it to work with Prestashop 8.1.7?

I found this module here: https://catalogo-onlinersi.net/en/modules-prestashop/255-image-color-fill-prestashop.html

imagefill.zip

Edited by Farwalker3
added module source (see edit history)
Link to comment
Share on other sites

Just now, endriu107 said:

This module is not compatible with prestashop 8.

I knew that much. I was hoping someone in this community would know how to make changes to this module to make it compatible. I currently have to edit the ImageManager.php file every time I want to change the background fill for the generated images. This is not ideal. This module I found was the closest I've gotten to being able to change the background fill without having to edit the PHP file.

I want a module that will allow me to change the generated product image background fill on the fly, and this older module tells me that was at one point possible in an older version of Prestashop. So, I assume it's possible to build a module that does the same thing, but for Prestashop 8.

Link to comment
Share on other sites

The error likely occurs because the module is not compatible with Prestashop 8.1.7. You can try the following steps:

Check Compatibility: Ensure the module is officially supported for Prestashop 8.1.7.

Validate Module Files: Look for any deprecated functions or hooks that may have been changed in Prestashop 8.x.

Check Logs: Review the error logs under Advanced Parameters > Logs in your Prestashop admin for more details.

Debug Module: Extract the module, check the config.xml for version compatibility, and review the PHP files for outdated methods.

If these steps don't work, the module may require manual code adjustments to function with the newer Prestashop version.

Link to comment
Share on other sites

Hello,

That module has not been updated in a really long time.

I created a new module from scratch that should accomplish the desired outcome. You can get it for free from here

The module is overriding the ImageManager.php class, thus you might potentially need to give some reading permissions to it (and some writing permissions to the override root directory), as they way PrestaShop works, it will copy the overridden class to the override root directory - if the module installs successfully, you should not care about this line ;)

I tested it with PHP 8.1 and PrestaShop 8.1.7. Please test it in a preprod environment first.

The module is open source, so if you believe it can be improved, please create a new issue in the Issues tab and I'll look into it. PRs are welcomed too.

  • Thanks 1
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...