Skip to content

Commit

Permalink
Disabled 'devel_generate' by removing it from core.extension.yml and
Browse files Browse the repository at this point in the history
creating a new update hook for uninstalling the module.

We also added the module to all.settings.php 'config_exclude_modules' list.
  • Loading branch information
Dresse committed Nov 1, 2024
1 parent df327bd commit 3a0bd94
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions assets/all.settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
'dpl_example_content',
'dpl_example_breadcrumb',
'devel',
'devel_generate',
'field_ui',
'purge_ui',
'views_ui',
Expand Down
1 change: 0 additions & 1 deletion config/sync/core.extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ module:
datetime_range: 0
dblog: 0
default_content: 0
devel_generate: 0
dpl_admin: 0
dpl_article: 0
dpl_breadcrumb: 0
Expand Down
23 changes: 23 additions & 0 deletions web/modules/custom/dpl_update/dpl_update.install
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@ function _dpl_update_install_modules(array $modules): string {
return "Enabled modules: {$modules_string}.";
}

/**
* Helper function to uninstall modules.
*
* @param string[] $modules
* The modules to install.
*
* @return string
* The feedback message.
*/
function _dpl_update_uninstall_modules(array $modules): string {
DrupalTyped::service(ModuleInstallerInterface::class, 'module_installer')->uninstall($modules);
$modules_string = implode(', ', $modules);
return "Uninstalled modules: {$modules_string}.";
}

/**
* Helper function, for adding translations.
*
Expand Down Expand Up @@ -84,6 +99,7 @@ function dpl_update_install(): string {
$messages[] = dpl_update_update_10017();
$messages[] = dpl_update_update_10018();
$messages[] = dpl_update_update_10019();
$messages[] = dpl_update_update_10020();

return implode('\r\n', $messages);
}
Expand Down Expand Up @@ -239,3 +255,10 @@ function dpl_update_update_10019(): string {

return $return;
}

/**
* Uninstall devel_generate module.
*/
function dpl_update_update_10020(): string {
return _dpl_update_uninstall_modules(['devel_generate']);
}

0 comments on commit 3a0bd94

Please sign in to comment.