Disabling module with config sync and removing with composer
Clash 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.
8 configuration-management composer uninstalling
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.
add a comment |Â
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.
8 configuration-management composer uninstalling
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.
add a comment |Â
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.
8 configuration-management composer uninstalling
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
8 configuration-management composer uninstalling
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.
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.
add a comment |Â
add a comment |Â
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?
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. Whendrush cim
recognizes some missing config, not knowing that some module will be uninstalled fromcore.extensions.yml
later. If I remember it right this can raise an exception.
– leymannx
11 mins ago
add a comment |Â
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:
- Uninstall the module
drush pmu module_name
- Export the configuration.
- Commit, push, and release.
- 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.
Yeah, but there may be other config related to that module. If I remember it right, it's not safe to just editcore.extension.yml
. The uninstallation routine needs to be triggered, to remove all other related config as well. And that needs to happen beforedrush cim
via an update hook.
– leymannx
4 mins ago
add a comment |Â
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?
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. Whendrush cim
recognizes some missing config, not knowing that some module will be uninstalled fromcore.extensions.yml
later. If I remember it right this can raise an exception.
– leymannx
11 mins ago
add a comment |Â
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?
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. Whendrush cim
recognizes some missing config, not knowing that some module will be uninstalled fromcore.extensions.yml
later. If I remember it right this can raise an exception.
– leymannx
11 mins ago
add a comment |Â
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?
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?
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. Whendrush cim
recognizes some missing config, not knowing that some module will be uninstalled fromcore.extensions.yml
later. If I remember it right this can raise an exception.
– leymannx
11 mins ago
add a comment |Â
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. Whendrush cim
recognizes some missing config, not knowing that some module will be uninstalled fromcore.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
add a comment |Â
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:
- Uninstall the module
drush pmu module_name
- Export the configuration.
- Commit, push, and release.
- 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.
Yeah, but there may be other config related to that module. If I remember it right, it's not safe to just editcore.extension.yml
. The uninstallation routine needs to be triggered, to remove all other related config as well. And that needs to happen beforedrush cim
via an update hook.
– leymannx
4 mins ago
add a comment |Â
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:
- Uninstall the module
drush pmu module_name
- Export the configuration.
- Commit, push, and release.
- 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.
Yeah, but there may be other config related to that module. If I remember it right, it's not safe to just editcore.extension.yml
. The uninstallation routine needs to be triggered, to remove all other related config as well. And that needs to happen beforedrush cim
via an update hook.
– leymannx
4 mins ago
add a comment |Â
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:
- Uninstall the module
drush pmu module_name
- Export the configuration.
- Commit, push, and release.
- 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.
Adding an alternative solution to @leymannx - you will still need two releases. This is taking into consideration your mention of drush cim
First release:
- Uninstall the module
drush pmu module_name
- Export the configuration.
- Commit, push, and release.
- 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.
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 editcore.extension.yml
. The uninstallation routine needs to be triggered, to remove all other related config as well. And that needs to happen beforedrush cim
via an update hook.
– leymannx
4 mins ago
add a comment |Â
Yeah, but there may be other config related to that module. If I remember it right, it's not safe to just editcore.extension.yml
. The uninstallation routine needs to be triggered, to remove all other related config as well. And that needs to happen beforedrush 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
add a comment |Â
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.
Francesco is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password