Jump to content
thirty bees forum
  • 0

Module Images Deleted after update


GTSol

Question

This is the third time I have updated some modules and the images related to the module no longer show after the update, showing just a question mark placeholder.

Modules:

  • Block Product Payment Logos
  • Block Image Slider
  • Block Banner
  • Theme Configurator

I have had to manually add the images again after the update - any ideas as to why this is happening?

 

Thanks in advance.

 

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 0

This is known bug, still not solved 😞

When updater updates a module, it removes the entire directory, and then unpacks the new module version. This deletes all files inside the module folder.

Proposed solution is to update these modules so they do not store their content inside module directory. 

For more info, read here

Link to comment
Share on other sites

  • 0

On each product page .. Or have I got the wrong end of the stick ....as usual ... I have used the short description for a image ..They all disappeared as did the 2 on my header ... Just had the camera image showing ..SAme thing happened on my other site but that was just slider images so wasn't that bad

Link to comment
Share on other sites

  • 0

Oh, it's not related to this problem then.

This is an issue with uploaded images that are stored inside /modules/<module>/ directory (instead of /img/ directory). When module is updated, its directory (including all upload images) is deleted and recreated from scratch. 

The root problem is in badly written modules, they need to be fixed to store their uploaded content outside of /modules/ directory. 

Link to comment
Share on other sites

  • 0

The best solution I have found so far is is to copy all the images to a different folder you create for the purpose in file manager, and or download all of them.   If you have already done the theme or slider upgrade and lost all the images, is to copy the images from a similar store, if you have one or upload them in mass through the file manager.   

Link to comment
Share on other sites

  • 0

After I updated, the module displays images in a different location to where it uploaded them. For now I have manually uploaded images to /modules/homeslider/images/ which didn't exist until I created it. Then change the uploaded files to the name found when I inspect the image source on the website.

Link to comment
Share on other sites

  • 0

Changing homeslider.tpl line 11 in my theme from -

src="{$link->getMediaLink("`$smarty.const._MODULE_DIR_`homeslider/images/`$slide.image|escape:'htmlall':'UTF-8'`")}

to 

src="{$link->getMediaLink("`$smarty.const`/img/homeslider/`$slide.image|escape:'htmlall':'UTF-8'`")}

fixed it.

Link to comment
Share on other sites

  • 0
38 minutes ago, MattR said:

Changing homeslider.tpl line 11 in my theme from -

src="{$link->getMediaLink("`$smarty.const._MODULE_DIR_`homeslider/images/`$slide.image|escape:'htmlall':'UTF-8'`")}

to 

src="{$link->getMediaLink("`$smarty.const`/img/homeslider/`$slide.image|escape:'htmlall':'UTF-8'`")}

fixed it.

 

Themes should not be responsible for constructing paths to assets. That creates dependency, and only leads to issues like this - it is very to change asset location without breaking themes.

Please use this instead:

src="{$link->getMediaLink($slide.imageUrl)|escape:'htmlall':'UTF-8'}"
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 0
On 1/27/2023 at 2:10 PM, datakick said:

 

Themes should not be responsible for constructing paths to assets. That creates dependency, and only leads to issues like this - it is very to change asset location without breaking themes.

Please use this instead:

src="{$link->getMediaLink($slide.imageUrl)|escape:'htmlall':'UTF-8'}"

Just so you know, this is NOT the way it is done in the TB 1.4 release that I recently downloaded. My slider images were broken as well until I replaced the aforementioned code line with this one in both the module location as well as the theme/module location.

Link to comment
Share on other sites

  • 0
1 hour ago, Obi said:

Just so you know, this is NOT the way it is done in the TB 1.4 release that I recently downloaded. My slider images were broken as well until I replaced the aforementioned code line with this one in both the module location as well as the theme/module location.

As I remember this fix was introduced at the current edge (so after 1.4 official) and it's normal for you to have to apply it manually.

After the merchant uses post 1.4 edge everything is OK.

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...