diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 324c97c..2d06d6f 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -450,7 +450,7 @@ function install_begin_request($class_loader, &$install_state) { } // Use the language from profile configuration if available. - if (isset($install_state['profile_info']['config_install']) && $install_state['profile_info']['config_install']) { + if (!empty($install_state['profile_info']['config_install'])) { $install_state['parameters']['langcode'] = $install_state['profile_info']['config']['system.site']['default_langcode']; } else { @@ -1272,7 +1272,7 @@ function _install_select_profile(&$install_state) { // Get all visible (not hidden) profiles. $visible_profiles = array_filter($install_state['profiles'], function ($profile) { $profile_info = install_profile_info($profile->getName()); - return !isset($profile_info['hidden']) || !$profile_info['hidden']; + return empty($profile_info['hidden']); }); } else { @@ -2307,7 +2307,7 @@ function install_config_import_batch() { } catch (ConfigImporterException $e) { // There are validation errors. - drupal_set_message(\Drupal::translation()->translate('The configuration synchronization failed validation.')); + drupal_set_message(t('The configuration synchronization failed validation.')); foreach ($config_importer->getErrors() as $message) { drupal_set_message($message, 'error'); } @@ -2353,7 +2353,7 @@ function install_config_import_batch_finish($success, $results, $operations) { drupal_set_message($error, 'error'); \Drupal::logger('config_sync')->error($error); } - drupal_set_message(\Drupal::translation()->translate('The configuration was imported with errors.'), 'warning'); + drupal_set_message(t('The configuration was imported with errors.'), 'warning'); } else { // Configuration sync needs a complete cache flush. @@ -2364,11 +2364,10 @@ function install_config_import_batch_finish($success, $results, $operations) { // An error occurred. // $operations contains the operations that remained unprocessed. $error_operation = reset($operations); - $message = \Drupal::translation() - ->translate('An error occurred while processing %error_operation with arguments: @arguments', [ - '%error_operation' => $error_operation[0], - '@arguments' => print_r($error_operation[1], TRUE) - ]); + $message = t('An error occurred while processing %error_operation with arguments: @arguments', [ + '%error_operation' => $error_operation[0], + '@arguments' => print_r($error_operation[1], TRUE) + ]); drupal_set_message($message, 'error'); } } @@ -2421,7 +2420,7 @@ function install_config_fix_profile() { } catch (ConfigImporterException $e) { // There are validation errors. - drupal_set_message(\Drupal::translation()->translate('The configuration synchronization failed validation.')); + drupal_set_message(t('The configuration synchronization failed validation.')); foreach ($config_importer->getErrors() as $message) { drupal_set_message($message, 'error'); }