diff --git a/core/modules/system/system.install b/core/modules/system/system.install index a1db970..47a1fba 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -497,7 +497,7 @@ function system_requirements($phase) { ]; } $cron_url = \Drupal::url('system.cron', ['key' => \Drupal::state()->get('system.cron_key'), ['absolute' => TRUE]]); - $requirements['cron']['description'][] = [ + $requirements['cron']['run_cron'][] = [ [ '#type' => 'link', '#title' => t('Run cron'), @@ -506,6 +506,15 @@ function system_requirements($phase) { ], '#url' => Url::fromRoute('system.run_cron'), ], + ]; + $requirements['cron']['cron_settings'][] = [ + [ + '#type' => 'link', + '#title' => t('more information'), + '#url' => Url::fromRoute('system.cron_settings'), + ], + ]; + $requirements['cron']['description'][] = [ [ '#prefix' => '
', '#markup' => t('To run cron from outside the site, go to @cron', [':url' => $cron_url, '@cron' => $cron_url]), diff --git a/core/themes/seven/css/components/system-status-report.css b/core/themes/seven/css/components/system-status-report.css index a14bc1e..c8168f3 100644 --- a/core/themes/seven/css/components/system-status-report.css +++ b/core/themes/seven/css/components/system-status-report.css @@ -57,7 +57,7 @@ .system-status-general-info__item-details { box-sizing: border-box; display: inline-block; - max-width: 80%; + width: 80%; padding-left: 10px; position: relative; } diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme index 8846764..b2358b4 100644 --- a/core/themes/seven/seven.theme +++ b/core/themes/seven/seven.theme @@ -149,8 +149,6 @@ function seven_preprocess_maintenance_page(&$variables) { */ function seven_preprocess_status_report(&$variables) { - $variables = _seven_alter_cron_description($variables); - $severities = [ REQUIREMENT_INFO => [ 'title' => t('Info'), @@ -292,44 +290,3 @@ function seven_form_node_form_alter(&$form, FormStateInterface $form_state) { $form['revision_information']['#type'] = 'container'; $form['revision_information']['#group'] = 'meta'; } - -/** - * Remove the cron button from the cron.description render array - * and add it as separate variable. - * - * @todo Only one sanity check is performed. Might be prudent to also - * return unchanged if either index has a count > 1 - */ -function _seven_alter_cron_description($variables) { - // find the Cron element - $cron = array_filter($variables['requirements'], function($requirement) { - return _seven_get_variable_index_by_title_string($requirement, 'title', 'Cron maintenance tasks'); - }); - $cron_index = current(array_keys($cron)); - - // Within Cron element, find the Run Cron link - $existing_run_cron_link = array_filter($variables['requirements'][$cron_index]['description'][0], function($render_element) { - return _seven_get_variable_index_by_title_string($render_element, '#title', 'Run cron'); - }); - $run_cron_index = current(array_keys($existing_run_cron_link)); - - // For sanity: if we don't have successful indexes return $variables unchanged - if (FALSE === $cron_index || FALSE === $run_cron_index) { - return $variables; - } - - // Remove the existing link that is nested in description and provide a new element - $new_link = $variables['requirements'][$cron_index]['description'][0][$run_cron_index]; - unset($variables['requirements'][$cron_index]['description'][0][$run_cron_index]); - $variables['requirements'][$cron_index]['run_cron'] = $new_link; - - return $variables; -} - -function _seven_get_variable_index_by_title_string($var, $key, $string) { - if (!array_key_exists($key, $var) || !method_exists($var[$key], 'getUntranslatedString')) { - return FALSE; - } - - return $var[$key]->getUntranslatedString() == $string; -} \ No newline at end of file diff --git a/core/themes/seven/templates/status-report.html.twig b/core/themes/seven/templates/status-report.html.twig index 7452c53..c984965 100644 --- a/core/themes/seven/templates/status-report.html.twig +++ b/core/themes/seven/templates/status-report.html.twig @@ -86,11 +86,15 @@

Last Cron Run

{{ cron.value }} + {% if cron.cron_settings %} +
({{ cron.cron_settings }}) + {% endif %} + {{ cron.run_cron }} {% if cron.run_cron %}
{{ cron.run_cron }}
{% endif %} {% if cron.description %} -
{{ cron.description }}
+
{{ cron.description }}
{% endif %}