Disabling module with config sync and removing with composer

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
3
down vote

favorite












I have an issue disabling modules, I've searched but cannot find something useful:

- Developer A disable module and via composer remove it

- I pull his changes so i run composer install that remove the code, then drush cim to update configuration, but it complains that the module is missing while it's trying to delete its configurations.



What's the right way to do this? I can't import config before running composer install because along the uninstalled module there could be also new modules needed for the configuration import.










share|improve this question







New contributor




Francesco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    up vote
    3
    down vote

    favorite












    I have an issue disabling modules, I've searched but cannot find something useful:

    - Developer A disable module and via composer remove it

    - I pull his changes so i run composer install that remove the code, then drush cim to update configuration, but it complains that the module is missing while it's trying to delete its configurations.



    What's the right way to do this? I can't import config before running composer install because along the uninstalled module there could be also new modules needed for the configuration import.










    share|improve this question







    New contributor




    Francesco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      I have an issue disabling modules, I've searched but cannot find something useful:

      - Developer A disable module and via composer remove it

      - I pull his changes so i run composer install that remove the code, then drush cim to update configuration, but it complains that the module is missing while it's trying to delete its configurations.



      What's the right way to do this? I can't import config before running composer install because along the uninstalled module there could be also new modules needed for the configuration import.










      share|improve this question







      New contributor




      Francesco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I have an issue disabling modules, I've searched but cannot find something useful:

      - Developer A disable module and via composer remove it

      - I pull his changes so i run composer install that remove the code, then drush cim to update configuration, but it complains that the module is missing while it's trying to delete its configurations.



      What's the right way to do this? I can't import config before running composer install because along the uninstalled module there could be also new modules needed for the configuration import.







      8 configuration-management composer uninstalling






      share|improve this question







      New contributor




      Francesco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      Francesco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      Francesco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 2 hours ago









      Francesco

      182




      182




      New contributor




      Francesco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Francesco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Francesco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          You need two consecutive releases for stuff like that.



          First release:



          Your colleague uninstalls the module and commits the updated config. But he also needs to ensure that the module needs to get uninstalled via some hook_update_N before the config gets imported in everybody else's setup.



          /**
          * Uninstall SOME_MODULE module.
          */
          function MYMODULE_update_8001(&$sandbox)

          Drupal::service('module_installer')->uninstall(['SOME_MODULE']);



          Second release:



          The module can be removed via Composer.




          Related:



          Order of drush commands for automated deployment?






          share|improve this answer






















          • Thanks, everything's clear to me! Thanks also for the related question, very intresting!
            – Francesco
            1 hour ago










          • You actually do not require an update hook just to uninstall the module. The configuration management in D8 could be used for it. Added an alternative answer built on top of your. cc @Francesco
            – AjitS
            30 mins ago










          • @AjitS – Unsure about that. When drush cim recognizes some missing config, not knowing that some module will be uninstalled from core.extensions.yml later. If I remember it right this can raise an exception.
            – leymannx
            11 mins ago

















          up vote
          0
          down vote













          Adding an alternative solution to @leymannx - you will still need two releases. This is taking into consideration your mention of drush cim



          First release:



          1. Uninstall the module drush pmu module_name

          2. Export the configuration.

          3. Commit, push, and release.

          4. Deploy and execute drush cim. That should uninstall the module.

          A hacky way to uninstall is directly editing the core.extension.yml, remove the complete entry of the module from under the module: key, and executing drush cim



          Second release:



          Removing module from composer.






          share|improve this answer




















          • Yeah, but there may be other config related to that module. If I remember it right, it's not safe to just edit core.extension.yml. The uninstallation routine needs to be triggered, to remove all other related config as well. And that needs to happen before drush cim via an update hook.
            – leymannx
            4 mins ago











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "220"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          Francesco is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdrupal.stackexchange.com%2fquestions%2f271202%2fdisabling-module-with-config-sync-and-removing-with-composer%23new-answer', 'question_page');

          );

          Post as a guest






























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote



          accepted










          You need two consecutive releases for stuff like that.



          First release:



          Your colleague uninstalls the module and commits the updated config. But he also needs to ensure that the module needs to get uninstalled via some hook_update_N before the config gets imported in everybody else's setup.



          /**
          * Uninstall SOME_MODULE module.
          */
          function MYMODULE_update_8001(&$sandbox)

          Drupal::service('module_installer')->uninstall(['SOME_MODULE']);



          Second release:



          The module can be removed via Composer.




          Related:



          Order of drush commands for automated deployment?






          share|improve this answer






















          • Thanks, everything's clear to me! Thanks also for the related question, very intresting!
            – Francesco
            1 hour ago










          • You actually do not require an update hook just to uninstall the module. The configuration management in D8 could be used for it. Added an alternative answer built on top of your. cc @Francesco
            – AjitS
            30 mins ago










          • @AjitS – Unsure about that. When drush cim recognizes some missing config, not knowing that some module will be uninstalled from core.extensions.yml later. If I remember it right this can raise an exception.
            – leymannx
            11 mins ago














          up vote
          2
          down vote



          accepted










          You need two consecutive releases for stuff like that.



          First release:



          Your colleague uninstalls the module and commits the updated config. But he also needs to ensure that the module needs to get uninstalled via some hook_update_N before the config gets imported in everybody else's setup.



          /**
          * Uninstall SOME_MODULE module.
          */
          function MYMODULE_update_8001(&$sandbox)

          Drupal::service('module_installer')->uninstall(['SOME_MODULE']);



          Second release:



          The module can be removed via Composer.




          Related:



          Order of drush commands for automated deployment?






          share|improve this answer






















          • Thanks, everything's clear to me! Thanks also for the related question, very intresting!
            – Francesco
            1 hour ago










          • You actually do not require an update hook just to uninstall the module. The configuration management in D8 could be used for it. Added an alternative answer built on top of your. cc @Francesco
            – AjitS
            30 mins ago










          • @AjitS – Unsure about that. When drush cim recognizes some missing config, not knowing that some module will be uninstalled from core.extensions.yml later. If I remember it right this can raise an exception.
            – leymannx
            11 mins ago












          up vote
          2
          down vote



          accepted







          up vote
          2
          down vote



          accepted






          You need two consecutive releases for stuff like that.



          First release:



          Your colleague uninstalls the module and commits the updated config. But he also needs to ensure that the module needs to get uninstalled via some hook_update_N before the config gets imported in everybody else's setup.



          /**
          * Uninstall SOME_MODULE module.
          */
          function MYMODULE_update_8001(&$sandbox)

          Drupal::service('module_installer')->uninstall(['SOME_MODULE']);



          Second release:



          The module can be removed via Composer.




          Related:



          Order of drush commands for automated deployment?






          share|improve this answer














          You need two consecutive releases for stuff like that.



          First release:



          Your colleague uninstalls the module and commits the updated config. But he also needs to ensure that the module needs to get uninstalled via some hook_update_N before the config gets imported in everybody else's setup.



          /**
          * Uninstall SOME_MODULE module.
          */
          function MYMODULE_update_8001(&$sandbox)

          Drupal::service('module_installer')->uninstall(['SOME_MODULE']);



          Second release:



          The module can be removed via Composer.




          Related:



          Order of drush commands for automated deployment?







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 32 mins ago

























          answered 1 hour ago









          leymannx

          5,89042356




          5,89042356











          • Thanks, everything's clear to me! Thanks also for the related question, very intresting!
            – Francesco
            1 hour ago










          • You actually do not require an update hook just to uninstall the module. The configuration management in D8 could be used for it. Added an alternative answer built on top of your. cc @Francesco
            – AjitS
            30 mins ago










          • @AjitS – Unsure about that. When drush cim recognizes some missing config, not knowing that some module will be uninstalled from core.extensions.yml later. If I remember it right this can raise an exception.
            – leymannx
            11 mins ago
















          • Thanks, everything's clear to me! Thanks also for the related question, very intresting!
            – Francesco
            1 hour ago










          • You actually do not require an update hook just to uninstall the module. The configuration management in D8 could be used for it. Added an alternative answer built on top of your. cc @Francesco
            – AjitS
            30 mins ago










          • @AjitS – Unsure about that. When drush cim recognizes some missing config, not knowing that some module will be uninstalled from core.extensions.yml later. If I remember it right this can raise an exception.
            – leymannx
            11 mins ago















          Thanks, everything's clear to me! Thanks also for the related question, very intresting!
          – Francesco
          1 hour ago




          Thanks, everything's clear to me! Thanks also for the related question, very intresting!
          – Francesco
          1 hour ago












          You actually do not require an update hook just to uninstall the module. The configuration management in D8 could be used for it. Added an alternative answer built on top of your. cc @Francesco
          – AjitS
          30 mins ago




          You actually do not require an update hook just to uninstall the module. The configuration management in D8 could be used for it. Added an alternative answer built on top of your. cc @Francesco
          – AjitS
          30 mins ago












          @AjitS – Unsure about that. When drush cim recognizes some missing config, not knowing that some module will be uninstalled from core.extensions.yml later. If I remember it right this can raise an exception.
          – leymannx
          11 mins ago




          @AjitS – Unsure about that. When drush cim recognizes some missing config, not knowing that some module will be uninstalled from core.extensions.yml later. If I remember it right this can raise an exception.
          – leymannx
          11 mins ago












          up vote
          0
          down vote













          Adding an alternative solution to @leymannx - you will still need two releases. This is taking into consideration your mention of drush cim



          First release:



          1. Uninstall the module drush pmu module_name

          2. Export the configuration.

          3. Commit, push, and release.

          4. Deploy and execute drush cim. That should uninstall the module.

          A hacky way to uninstall is directly editing the core.extension.yml, remove the complete entry of the module from under the module: key, and executing drush cim



          Second release:



          Removing module from composer.






          share|improve this answer




















          • Yeah, but there may be other config related to that module. If I remember it right, it's not safe to just edit core.extension.yml. The uninstallation routine needs to be triggered, to remove all other related config as well. And that needs to happen before drush cim via an update hook.
            – leymannx
            4 mins ago















          up vote
          0
          down vote













          Adding an alternative solution to @leymannx - you will still need two releases. This is taking into consideration your mention of drush cim



          First release:



          1. Uninstall the module drush pmu module_name

          2. Export the configuration.

          3. Commit, push, and release.

          4. Deploy and execute drush cim. That should uninstall the module.

          A hacky way to uninstall is directly editing the core.extension.yml, remove the complete entry of the module from under the module: key, and executing drush cim



          Second release:



          Removing module from composer.






          share|improve this answer




















          • Yeah, but there may be other config related to that module. If I remember it right, it's not safe to just edit core.extension.yml. The uninstallation routine needs to be triggered, to remove all other related config as well. And that needs to happen before drush cim via an update hook.
            – leymannx
            4 mins ago













          up vote
          0
          down vote










          up vote
          0
          down vote









          Adding an alternative solution to @leymannx - you will still need two releases. This is taking into consideration your mention of drush cim



          First release:



          1. Uninstall the module drush pmu module_name

          2. Export the configuration.

          3. Commit, push, and release.

          4. Deploy and execute drush cim. That should uninstall the module.

          A hacky way to uninstall is directly editing the core.extension.yml, remove the complete entry of the module from under the module: key, and executing drush cim



          Second release:



          Removing module from composer.






          share|improve this answer












          Adding an alternative solution to @leymannx - you will still need two releases. This is taking into consideration your mention of drush cim



          First release:



          1. Uninstall the module drush pmu module_name

          2. Export the configuration.

          3. Commit, push, and release.

          4. Deploy and execute drush cim. That should uninstall the module.

          A hacky way to uninstall is directly editing the core.extension.yml, remove the complete entry of the module from under the module: key, and executing drush cim



          Second release:



          Removing module from composer.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 32 mins ago









          AjitS

          10k73266




          10k73266











          • Yeah, but there may be other config related to that module. If I remember it right, it's not safe to just edit core.extension.yml. The uninstallation routine needs to be triggered, to remove all other related config as well. And that needs to happen before drush cim via an update hook.
            – leymannx
            4 mins ago

















          • Yeah, but there may be other config related to that module. If I remember it right, it's not safe to just edit core.extension.yml. The uninstallation routine needs to be triggered, to remove all other related config as well. And that needs to happen before drush cim via an update hook.
            – leymannx
            4 mins ago
















          Yeah, but there may be other config related to that module. If I remember it right, it's not safe to just edit core.extension.yml. The uninstallation routine needs to be triggered, to remove all other related config as well. And that needs to happen before drush cim via an update hook.
          – leymannx
          4 mins ago





          Yeah, but there may be other config related to that module. If I remember it right, it's not safe to just edit core.extension.yml. The uninstallation routine needs to be triggered, to remove all other related config as well. And that needs to happen before drush cim via an update hook.
          – leymannx
          4 mins ago











          Francesco is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          Francesco is a new contributor. Be nice, and check out our Code of Conduct.












          Francesco is a new contributor. Be nice, and check out our Code of Conduct.











          Francesco is a new contributor. Be nice, and check out our Code of Conduct.













           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdrupal.stackexchange.com%2fquestions%2f271202%2fdisabling-module-with-config-sync-and-removing-with-composer%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          What does second last employer means? [closed]

          List of Gilmore Girls characters

          One-line joke