// No try-catch, we want a failure to throw an error.
$installer->install([$external_module]);
returnt('@external_module has already been installed.',[
'@external_module'=>$external_module,
]);
}
// If the new module does not exist but the old submodule is enabled,
// we need to tell the user to composer require it. We will then fail this
// update hook so that we can try it again later after they have carried out
// the composer install.
if(!$list->exists($external_module)){
$message=t('@submodule has moved from the AI Core to a separate module. Please run `composer require drupal/@external_module` then run this update hook again.',[
'@submodule'=>$submodule,
'@external_module'=>$external_module,
]);
die((string)$message);
}
// New module is installed but so does is the old submodule (since we
// already checked that above), but as noted.
if($handler->moduleExists($external_module)){
$message=t("Only '@external_module' should be installed, not '@submodule'.",[
'@external_module'=>$external_module,
'@submodule'=>$submodule,
]);
die((string)$message);
}
returnt('@submodule-module moving to contributed @external_module-module has been completed.',[