diff --git a/core/modules/aggregator/aggregator.pages.inc b/core/modules/aggregator/aggregator.pages.inc index dc9433611ca..4310d79c31f 100644 --- a/core/modules/aggregator/aggregator.pages.inc +++ b/core/modules/aggregator/aggregator.pages.inc @@ -6,6 +6,7 @@ */ use Drupal\aggregator\Plugin\Core\Entity\Feed; +use Drupal\Core\Entity\EntityInterface; /** * Page callback: Displays the most recent items gathered from any feed. @@ -563,7 +564,7 @@ function theme_aggregator_page_opml($variables) { * @see aggregator-summary-items.tpl.php */ function template_preprocess_aggregator_summary_items(&$variables) { - $variables['title'] = check_plain($variables['source']->label()); + $variables['title'] = check_plain($variables['source'] instanceof EntityInterface ? $variables['source']->label() : $variables['source']->title); $summary_items = array(); foreach (element_children($variables['summary_items']) as $key) { $summary_items[] = $variables['summary_items'][$key]; @@ -572,7 +573,7 @@ function template_preprocess_aggregator_summary_items(&$variables) { '#theme' => 'item_list', '#items' => $summary_items, ); - $variables['source_url'] = $variables['source']->url->value; + $variables['source_url'] = $variables['source'] instanceof EntityInterface ? $variables['source']->url->value : $variables['source']->url; } /** diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedTest.php index ba360a8e963..569f26affcb 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedTest.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedTest.php @@ -48,5 +48,10 @@ class CategorizeFeedTest extends AggregatorTestBase { $db_feed = aggregator_feed_load($db_fid); // Assert the feed has two categories. $this->assertEqual(count($db_feed->categories), 2, 'Feed has 2 categories'); + + // Verify the categories overview page is correctly displayed. + $this->drupalGet('aggregator/categories'); + $this->assertText($category_1['title']); + $this->assertText($category_2['title']); } }