Skip to content
Snippets Groups Projects

ISTWCMS-6540: adding update hook for password policy modules

1 file
+ 26
0
Compare changes
  • Side-by-side
  • Inline
+ 26
0
@@ -1470,3 +1470,29 @@ function uw_sites_all_update_9135(&$sandbox) {
\Drupal::service('module_installer')->install($modules);
}
/**
* Install password policy modules.
*/
function uw_sites_all_update_9136(&$sandbox) {
// The module handler service.
$module_handler = \Drupal::service('module_handler');
// Modules to check and install.
$modules = [
'password_policy',
'password_policy_length',
'password_policy_characters',
'password_policy_history',
'password_policy_username',
];
// Step through each module and if not enabled,
// then enable it.
foreach ($modules as $module) {
if (!\Drupal::service('module_handler')->moduleExists($module)) {
\Drupal::service('module_installer')->install([$module]);
}
}
}
Loading