Jump to content

Programatically reset modules.


Recommended Posts

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

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

  • 3 weeks later...
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

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

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

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

Posted (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 by zunxunz
typo (see edit history)
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...