Jump to content
thirty bees forum
  • 0

Upgrading Themeconfigurator is deleting images


Question

Posted

Hello everyone, first of all, thank you for your great job! i use TB 1.0.4 with Perfectum theme from smartdatasoft, after many tests and eliminating some buggy (or unneeded) module, eveything is running smoothly and i am absolutely satisfied with TB ... just one question ... everytime i upgrade the themeconfigurator module, it deletes the corresponding images on home ... and i have to reupload them again, not a big problem, but it is a bit annoying ... today the second time it happen Can anyybody pointing me where and what i can check? i've looked a bit at the module's code but i'm not really expert, just learning things by the way, and i can't understand why it deletes the image istead of just keep them as before upgrade. Thank you in advance if somebody have any suggestion ...

11 answers to this question

Recommended Posts

  • 0
Posted

AFAIK, uploading a module removes the old module directory completely, then unpacks the new one in place. Which obviously means that images get reset as well.

Custom images shouldn't replace the ones inside the module directory, be get placed in the theme. Each theme comes with a modules/ directory, files inside there override the default ones in the module. Accordingly, custom images should go into themes/<theme>/modules/themeconfigurator/img/.

So far the theory, I didn't actually try.

  • 0
Posted

I can confirm this issue! It's probably the same as in homeslider module... I have just added an issue on github with the homeslider module: https://github.com/thirtybees/homeslider/issues/3

@ariom are you using the multistore feature?

  • 0
Posted

Thanks for replying ... @wakabayashi no, i'm not using multistore feature mmh, you think is better i also make a bug report on github?

@Traumflug thanks for explaination, i will do as for your suggestion, waiting for next module update, which i think is not coming so soon, to see if it works ..

  • 0
Posted

I checked this - when we manually upload module zip file from backend, its content is merged with the existing module directory. However, when module is updated using tbupdater module, the old module directory is completely deleted and replaced by content from zip package.

Although the tbupdater approach sounds like a much better way to me (definitely more predictable and maintainable), I'm afraid it breaks backward compatibility - any module that stores some data to its own directory will be affected by this.

Maybe the best solution would be some mixed approach - replace all code files (*.php, *.tpl , *.js , *.html , *.css ) , but keep binary data (images, etc).

Also, it would be nice if the same algorithm were used for both manual installation and tbupdater

  • 0
Posted

Thanks for investigating this, @datakick.

It turns out images were always overwritten with updates. Just nobody noticed, because there were no updates.

Updating only certain files is a tricky thing, because not all images are meant to be replaced by merchants. There are also logos, icons and such stuff. Also, not erasing the whole directory means that obsolete files, code or not code, stay in place, potentially messing things up.

The golden approach would probably be to get modules into installing their images in img/ properly. Not too hard to implement, because there is install() and uninstall() already, but it has to be done.

  • 0
Posted

If the tbupdater is meant only for those native thirtybees modules, then it makes sense to fix these. It could be a lot of work, though, as someone would have to go through all of them.

If, in the future, you plan to use tbupdater module to install / update third party modules (for example community modules from tb store), than this could be a big problem. I've seen many modules that allow user to uploads images (or other files) and stores them somewhere in module's directory. It's not realistic to expect that module developer will fix this.

I'm afraid we'll need to choose the lesser evil here. The replace method would keep module code clean, but module updates might result in loss of file-data. The merge method can result in quite a mess in the module directory, with outdated / unused files everywhere. But the module will still work in 99% of the time (unless it does some dangerous *.php autoloading), and no data will be lost.

But we definitely need to decide which algorithm to use, and use it both in tbupdater, and in manual module update in core

  • 0
Posted

I think that, sadly, it's pretty clear the merging functionality needs to be used to avoid breaking modules that allow uploading stuff into the module's folder. This is one of those baggage things from PS that can't be avoided for now.

  • 0
Posted

@Traumflug i wrote this post after a local update of the module, today i tried to update on live site following your suggestion... uploaded the module img folder inside my theme module's folder and done automatic update .... same result, images are lost @gonssal you are right, this actually looks like the only way to update some module and bypass the problem ...

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