zlash Posted August 26, 2014 Share Posted August 26, 2014 I have made a module with a file in the classes folder and when I try to install it it says : Impossible d'installer la surcharge : Ce répertoire doit être modifiable : .../override/override/controllers/admin The funny thing is if I wait for a couple of days it works again until I install/deinstall it. Is there some cache that is not to be found in the configuration of prestashop?? Link to comment Share on other sites More sharing options...
vekia Posted August 26, 2014 Share Posted August 26, 2014 if you module use overrides, it's normal. http://doc.prestashop.com/display/PS15/Overriding+default+behaviors if prestashop cant move these files there - it's probably related to permissions of directory mentioned in the error notify Link to comment Share on other sites More sharing options...
zlash Posted August 27, 2014 Author Share Posted August 27, 2014 Actually if you look closer, there is override two times in the path, which is not normal. But I figured out that this had somehow to do with the cache, deleting files in the cache and deleting manually all the overrides after uninstalling my module made the trick. I think that instead of not deleting installed overrides when uninstalling a module prestashop could rename these files, adding the date/time of the uninstallation to it. This way it would be possible to install/uninstall/reinstall a module without having to worry about deleting the overrides manually. Link to comment Share on other sites More sharing options...
bellini13 Posted August 27, 2014 Share Posted August 27, 2014 Prestashop varies on what it does with overrides when removing a module. What happens if 2 modules override the same class/controller. If you only uninstall 1 module, what should Prestashop do? Instead of relying on Prestashop to guess correctly, you should construct your override in a way that it detects if your module is installed and enabled, and only then execute the override code. Otherwise if it is not installed/enabled, then you would only execute the parent function and return, skipping your override logic. This is the safest way to ensure that the override code is not executed if the override is not removed. Link to comment Share on other sites More sharing options...
zlash Posted August 27, 2014 Author Share Posted August 27, 2014 Thank you for your feedback Bellini, what you suggest sounds great! I will try this. But you raise a question which I have been wondering about indeed and found no answer so far, what happens if 2 different modules override the same controller for example, which one does Prestashop take in account?? Link to comment Share on other sites More sharing options...
bellini13 Posted August 27, 2014 Share Posted August 27, 2014 I believe the answer depends on the PS version. In one case it will not merge them at all, in another case as long as the functions do not conflict, PS will just merge them 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