diff --git a/core/includes/install.inc b/core/includes/install.inc index 7f5e88b..3e76648 100644 --- a/core/includes/install.inc +++ b/core/includes/install.inc @@ -7,6 +7,7 @@ use Drupal\Component\Utility\Unicode; use Drupal\Core\Config\PreExistingConfigException; +use Drupal\Core\Config\UnmetDependenciesException; use Symfony\Component\HttpFoundation\RedirectResponse; use Drupal\Component\Utility\Crypt; use Drupal\Component\Utility\OpCodeCache; @@ -1118,7 +1119,7 @@ function _install_module_batch($module, $module_name, &$context) { catch (PreExistingConfigException $e) { $config_objects = $e->flattenConfigObjects($e->getConfigObjects()); drupal_set_message( - $this->formatPlural( + \Drupal::translation()->formatPlural( count($config_objects), 'Unable to install @extension, %config_names already exists in active configuration.', 'Unable to install @extension, %config_names already exist in active configuration.', @@ -1129,6 +1130,13 @@ function _install_module_batch($module, $module_name, &$context) { 'error' ); } + catch (UnmetDependenciesException $e) { + drupal_set_message( + $e->getTranslatedMessage(\Drupal::translation(), $module), + 'error' + ); + return; + } $context['results'][] = $module; $context['message'] = t('Installed %module module.', array('%module' => $module_name));