Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Labels:None
-
Similar issues:PSCFV-7022 Improvements on shop setting interfaces
PSCFV-7050 Perf enhancement : in modules contructor, avoid contruction specific for back_officePSCFV-5999cant't install Module override because of override file doesn't existsPSCFV-7406Override mail template from modulePSCFV-4906Override module templates can't translatePSCFV-5512Automatic override from a module deletes duplicate if any
PSCFV-9105 On module install, overrided pdf class don't create a copy to override/pdf
PSCFV-7370 Override back office templates when a module is installed
Description
Module X needs to override FrontController (and it is already overriden/customized)
Option a) Go ahead and override... in the process cloberring any other overrides or customizations
Option b) Notice that it is already overriden and abort, failing install
Option c) Painstakingly parse the override trying to make sense of what was overriden and work aroud it
Can we have an option d please?
Create table overrides - class, member, overrider
Module (or Tools)::isOverriden(class, member)
Module::addOverride(class, member)
Module::removeOverride(class, member)
or even Module->overrides = array { classA =. member, classB =>member }
Or alternatively provide per module overrides in modules/module/overrides/...
pretty please?
Hello,

your idea is now implemented
You can add a folder override/ in your module where you put the files you want to override, and all method of these files will be imported in the original override/ folder. For example do a test module with a file modules/test/override/classes/Product.php, add a method in your file, and when the module will be installed open the file override/classes/Product.php, you will see that the code is copied in
Regards