Core modules override without being overwritten with a composer-update (v1)
Hi, just a quick question:
I'd like to make some minor adjustments to the
Usermodule (giving always at least the permission to view the dashboard, even if the administrator forgets to give the rights to do so).
Is there any way to extend/override the default behavior of a module? It'd be a bit overkill to duplicate the module and make my own CustomUsers just for one line of code I have to change...
Same happens with
Mediamodule. I have minor changes to distinguish between audio & video files, but I lose all my changes at each
I need to have the whole module in
.gitignorein order to 'rescue' my modifications, as a workaround.
So, where'd be the best place to apply this changes without breaking the flow / modularity ?
Yes you have 2 options:
- Commit the module, and remove it from the composer.json file
- Fork the module, and use your fork instead of the original one.
Fantastic, many thanks, I'll try the first option
@nwidart Hi, i try to remove from composer, and composer delete my modules on server deploy, why?
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 26 installs, 44 updates, 2 removals
Deleting Modules/Workshop/ - deleted
Deleting Modules/User/ - deleted
This is normal composer behaviour. After composer has removed your module you can get it back using git, or just by copying the folder before hand and put it back afterwards.