Make it possible to create a "all versions" upgrade-file for modules #36255
madsoliver
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The problem
When working on my modules, and when it is time for a new version, I usually want the new version to run some common tasks. I would as an example allways run
$this->registerHook($this->hooks);
or$this->updateTableSchema()
.The current sollution is to create new files into
mymodule/upgrades
-directory, naming the file with the new version. In most of my modules all those files are identical, and that bothers me, cause I am lazy 😉The solution
Making it possible to create ONE file into the same directory called for example
mymodule/upgrades/Upgrade-All.php
, then ALLWAYS include that file when upgrading the module - then we could add common tasks in that file.It would not interfere with todays upgrade files.
Tested and working:
Alternatives
I tried using the hook
actionBeforeUpgradeModule
, but that does not work since, cause right before the hook is called, this is executed:$this->hookManager->disableHooksForModule($this->moduleDataProvider->getModuleIdByName($name));
Additional context
No response
Do you plan to work on this subject?
Beta Was this translation helpful? Give feedback.
All reactions