commit 906bb9820ee693f57de98e70793160555bcee4cc Author: Joel Pittet Date: Fri Jul 25 19:49:15 2014 -0700 shuffle diff --git a/core/modules/update/src/Controller/UpdateController.php b/core/modules/update/src/Controller/UpdateController.php index f9419b3..59ef8ce 100644 --- a/core/modules/update/src/Controller/UpdateController.php +++ b/core/modules/update/src/Controller/UpdateController.php @@ -56,9 +56,6 @@ public function updateStatus() { $this->moduleHandler()->loadInclude('update', 'compare.inc'); $build['#data'] = update_calculate_project_data($available); } - else { - $build['#data'] = _update_no_data(); - } return $build; } diff --git a/core/modules/update/templates/update-report.html.twig b/core/modules/update/templates/update-report.html.twig index 1b1cc89..d3cba0c 100644 --- a/core/modules/update/templates/update-report.html.twig +++ b/core/modules/update/templates/update-report.html.twig @@ -5,6 +5,7 @@ * * Available variables: * - last_checked: Themed last time update data was checked. + * - update_no_data: Message when there are no project updates. * - project_types: A list of project types. * - label: The project type label. * - table: The project status table. @@ -19,4 +20,6 @@ {% for project_type in project_types %}

{{ project_type.label }}

{{ project_type.table }} +{% else %} + {{ update_no_data }} {% endfor %} diff --git a/core/modules/update/update.report.inc b/core/modules/update/update.report.inc index ff8b789..275f9a6 100644 --- a/core/modules/update/update.report.inc +++ b/core/modules/update/update.report.inc @@ -28,8 +28,19 @@ function template_preprocess_update_report(&$variables) { $variables['last_checked'] = array( '#theme' => 'update_last_check', '#last' => $last, + // Attach the library to a variable that gets printed always. + '#attached' => array( + 'library' => array( + 'update/drupal.update.admin', + ), + ) ); + // For no project update data, populate no data message. + if (empty($data)) { + $variables['update_no_data'] = _update_no_data(); + } + $rows = array(); // Create an array of status values keyed by module or theme name, since @@ -101,16 +112,6 @@ function template_preprocess_update_report(&$variables) { ); } } - - $assets = array( - '#attached' => array( - 'library' => array( - 'update/drupal.update.admin', - ), - ) - ); - - return drupal_render($assets); } /**