diff -u b/core/modules/system/system.install b/core/modules/system/system.install --- b/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -340,6 +340,8 @@ $threshold_warning = $cron_config->get('threshold.requirements_warning'); // Cron error threshold defaults to two weeks. $threshold_error = $cron_config->get('threshold.requirements_error'); + // Cron configuration help text. + $help = t('For more information, see the online handbook entry for configuring cron jobs.', array('@cron-handbook' => 'https://www.drupal.org/cron')); // Determine when cron last ran. $cron_last = \Drupal::state()->get('system.cron_last'); @@ -358,29 +360,23 @@ // Set summary and description based on values determined above. $summary = t('Last run !time ago', array('!time' => \Drupal::service('date.formatter')->formatTimeDiffSince($cron_last))); + $description = ''; if ($severity != REQUIREMENT_INFO) { - $description = t('Cron has not run recently. For more information, see the online handbook entry for configuring cron jobs. You can run cron manually.
To run cron from outside the site, go to @cron-outside', - array( - '@cron-handbook' => 'https://www.drupal.org/cron', - '@cron-manual' => \Drupal::url('system.run_cron'), - '@cron-outside' => \Drupal::url('system.cron', array('key' => \Drupal::state()->get('system.cron_key'), array('absolute' => TRUE))), - ) - ); - } - else { - $description = t('You can run cron manually.
To run cron from outside the site, go to @cron-outside', - array( - '@cron-manual' => \Drupal::url('system.run_cron'), - '@cron-outside' => \Drupal::url('system.cron', array('key' => \Drupal::state()->get('system.cron_key'), array('absolute' => TRUE))), - ) - ); + $description = t('Cron has not run recently.') . ' ' . $help; } + $description .= ' ' . t('You can run cron manually.', array('@cron' => \Drupal::url('system.run_cron'))); + $description .= '
' . t('To run cron from outside the site, go to !cron', array('!cron' => \Drupal::url('system.cron', array('key' => \Drupal::state()->get('system.cron_key'), array('absolute' => TRUE))))); + $requirements['cron'] = array( 'title' => t('Cron maintenance tasks'), 'severity' => $severity, 'value' => $summary, - 'description' => $description, + // @todo This string is concatenated from t() calls, safe drupal_render() + // output, whitespace, and
tags, so is safe. However, as a best + // practice, we should not use SafeMarkup::set() around a variable. Fix + // in: https://www.drupal.org/node/2296929. + 'description' => SafeMarkup::set($description), ); } if ($phase != 'install') { @@ -419,8 +415,6 @@ $threshold_warning = $cron_config->get('threshold.requirements_warning'); // Cron error threshold defaults to two weeks. $threshold_error = $cron_config->get('threshold.requirements_error'); - // Cron configuration help text. - $help = t('For more information, see the online handbook entry for configuring cron jobs.', array('@cron-handbook' => 'https://www.drupal.org/cron')); // Determine when cron last ran. $cron_last = \Drupal::state()->get('system.cron_last'); @@ -439,24 +433,25 @@ // Set summary and description based on values determined above. $summary = t('Last run !time ago', array('!time' => \Drupal::service('date.formatter')->formatTimeDiffSince($cron_last))); - $description = ''; - if ($severity != REQUIREMENT_INFO) { - $description = t('Cron has not run recently.') . ' ' . $help; - } - - $description .= ' ' . t('You can run cron manually.', array('@cron' => \Drupal::url('system.run_cron'))); - $description .= '
' . t('To run cron from outside the site, go to !cron', array('!cron' => \Drupal::url('system.cron', array('key' => \Drupal::state()->get('system.cron_key'), array('absolute' => TRUE))))); $requirements['cron'] = array( 'title' => t('Cron maintenance tasks'), 'severity' => $severity, 'value' => $summary, - // @todo This string is concatenated from t() calls, safe drupal_render() - // output, whitespace, and
tags, so is safe. However, as a best - // practice, we should not use SafeMarkup::set() around a variable. Fix - // in: https://www.drupal.org/node/2296929. - 'description' => SafeMarkup::set($description), ); + if ($severity != REQUIREMENT_INFO || TRUE) { + $requirements['cron']['description'][] = ['#markup' => t('Cron has not run recently.')]; + $requirements['cron']['description'][] = [ + '#prefix' => ' ', + '#markup' => t('For more information, see the online handbook entry for configuring cron jobs.'), + '#suffix' => ' ', + ]; + } + $requirements['cron']['description'][] = ['#markup' => t('You can run cron manually.', ['@cron' => \Drupal::url('system.run_cron')])]; + $requirements['cron']['description'][] = [ + '#prefix' => '
', + '#markup' => t('To run cron from outside the site, go to @cron', ['@cron' => \Drupal::url('system.cron', ['key' => \Drupal::state()->get('system.cron_key'), ['absolute' => TRUE]])]), + ]; } if ($phase != 'install') { $filesystem_config = \Drupal::config('system.file');