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 User module (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 Media module. I have minor changes to distinguish between audio & video files, but I lose all my changes at each composer-update.

    I need to have the whole module in .gitignore in order to 'rescue' my modifications, as a workaround.

    So, where'd be the best place to apply this changes without breaking the flow / modularity ?


  • admin

    Hi,

    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.


  • @nWidart
    Fantastic, many thanks, I'll try the first option


Log in to reply