zunxunz Posted May 9 Share Posted May 9 Is there a way to remotely or programatically reset modules? I need to update modules for multiple shops frequently. Accessing the b/o and manually resetting them for each module, every time, is very tedious. Even a local script that would reset them would be better. Link to comment Share on other sites More sharing options...
Mediacom87 Posted May 10 Share Posted May 10 Hi, What does updating modules have to do with resetting them, because as far as I'm concerned, these are two completely different things? In any case, updating modules can cause errors on some stores, so automating this task seems dangerous to me. When it comes to resetting a module, the problem is that it depends on each module: some delete all the data, others don't, so you need to be careful and know what you're doing. Link to comment Share on other sites More sharing options...
zunxunz Posted May 28 Author Share Posted May 28 On 5/10/2025 at 2:10 AM, Mediacom87 said: Hi, What does updating modules have to do with resetting them, because as far as I'm concerned, these are two completely different things? In any case, updating modules can cause errors on some stores, so automating this task seems dangerous to me. When it comes to resetting a module, the problem is that it depends on each module: some delete all the data, others don't, so you need to be careful and know what you're doing. Answer to your question. I have a bunch of custom modules. After the code has been updated, they sometimes need to be reset. Since they are multiple shops and multiple modules, this is very tedious to do manually. "When it comes to resetting a module, the problem is that it depends on each module: some delete all the data, others don't, so you need to be careful and know what you're doing." Yes, I know exactly what I'm doing. Link to comment Share on other sites More sharing options...
Mediacom87 Posted May 29 Share Posted May 29 Il y a 17 heures, zunxunz a dit : Answer to your question. I have a bunch of custom modules. After the code has been updated, they sometimes need to be reset. Since they are multiple shops and multiple modules, this is very tedious to do manually. If you have to reinitialize a module after updating it, it's because it was poorly developed. So inform the creator so he can correct the problem. Link to comment Share on other sites More sharing options...
zunxunz Posted May 30 Author Share Posted May 30 22 hours ago, Mediacom87 said: If you have to reinitialize a module after updating it, it's because it was poorly developed. So inform the creator so he can correct the problem. I'd rather you just answer the original question in stead of trying to teach me what to do or what not to do, is there a way to remotely or programatically reset modules? Link to comment Share on other sites More sharing options...
Mediacom87 Posted May 30 Share Posted May 30 Il y a 3 heures, zunxunz a dit : I'd rather you just answer the original question in stead of trying to teach me what to do or what not to do, is there a way to remotely or programatically reset modules? There is no native solution in PrestaShop to meet this need. However, it is entirely possible to develop a custom script or module to implement it. Having said that, I'd like to draw your attention to the fact that such a system could prove counter-productive, or even a source of complications. You'll probably discover its limitations as you use it. Link to comment Share on other sites More sharing options...
zunxunz Posted May 30 Author Share Posted May 30 (edited) 1 hour ago, Mediacom87 said: There is no native solution in PrestaShop to meet this need. However, it is entirely possible to develop a custom script or module to implement it. Having said that, I'd like to draw your attention to the fact that such a system could prove counter-productive, or even a source of complications. You'll probably discover its limitations as you use it. Thank you for your answer and your concern. You're quite correct in pointing out that this should not be used carelessly. FYI: in the mean time I did find out that Symfony in fact provides a console command to reset a module: user@machine: php bin/console prestashop:module reset modulename Edited May 30 by zunxunz typo (see edit history) Link to comment Share on other sites More sharing options...
Knowband Plugins Posted May 31 Share Posted May 31 The module class has the install & uninstall functions. I think these function can also be used to reset he module. $module = Module::getInstanceByName($module_name); $module->uninstall() $module->install() Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now