diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module index 6c43b69..29bc648 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -868,3 +868,20 @@ function template_preprocess_forum_submitted(&$variables) { function theme_forum_form(array $variables) { return drupal_render_children($variables['form']); } + +/** + * Implements hook_library_info(). + * + * Forum specific libraries. + */ +function forum_library_info() { + $libraries['forum.index'] = array( + 'title' => 'Forum index', + 'version' => \Drupal::VERSION, + 'css' => array( + drupal_get_path('module', 'forum') . '/css/forum.module.css' => array(), + ), + ); + + return $libraries; +} diff --git a/core/modules/forum/lib/Drupal/forum/Controller/ForumController.php b/core/modules/forum/lib/Drupal/forum/Controller/ForumController.php index 131c1fe..95b2923 100644 --- a/core/modules/forum/lib/Drupal/forum/Controller/ForumController.php +++ b/core/modules/forum/lib/Drupal/forum/Controller/ForumController.php @@ -177,8 +177,8 @@ protected function build($forums, TermInterface $term, $topics = array(), $paren '#sortby' => $this->config->get('topics.order'), '#forums_per_page' => $this->config->get('topics.page_limit'), ); - // @todo Make this a library - see https://drupal.org/node/2028113. - $build['#attached']['css'][] = drupal_get_path('module', 'forum') . '/css/forum.module.css'; + $build['#attached']['library'][] = array('forum', 'forum.index'); + return $build; }