diff --git a/core/modules/aggregator/aggregator.routing.yml b/core/modules/aggregator/aggregator.routing.yml index 77e741d..b9a17a6 100644 --- a/core/modules/aggregator/aggregator.routing.yml +++ b/core/modules/aggregator/aggregator.routing.yml @@ -53,7 +53,7 @@ aggregator_page_last: _controller: '\Drupal\aggregator\Routing\AggregatorController::pageLast' aggregator_sources: - pattern: 'aggregator/sources' + pattern: '/aggregator/sources' defaults: _content: '\Drupal\aggregator\Routing\AggregatorController::sources' requirements: diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Routing/AggregatorController.php b/core/modules/aggregator/lib/Drupal/aggregator/Routing/AggregatorController.php index 0d1d831..ccc3138 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Routing/AggregatorController.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Routing/AggregatorController.php @@ -7,6 +7,7 @@ namespace Drupal\aggregator\Routing; +use Drupal\aggregator\FeedInterface; use Drupal\Core\Config\ConfigFactory; use Drupal\Core\Controller\ControllerInterface; use Drupal\Core\Database\Connection; @@ -239,15 +240,17 @@ public function sources() { $feeds = $this->entityManager->getStorageController('aggregator_feed')->load(); - // @todo remove this once aggregator_load_feed_items() is refactored after - // http://drupal.org/node/15266 is in. - \Drupal::moduleHandler()->loadInclude('aggregator', 'inc', 'aggregator.pages'); - $build = array( '#type' => 'container', '#attributes' => array('class' => array('aggregator-wrapper')), '#sorted' => TRUE, ); + + // @todo remove this once aggregator_load_feed_items() is refactored after + // http://drupal.org/node/15266 is in. + \Drupal::moduleHandler()->loadInclude('aggregator', 'inc', 'aggregator.pages'); + + foreach ($feeds as $feed) { // Most recent items: $summary_items = array(); diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorRenderingTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorRenderingTest.php index 598f348..2f3097d 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorRenderingTest.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorRenderingTest.php @@ -96,6 +96,16 @@ public function testFeedPage() { $elements = $this->xpath("//ul[@class=:class]", array(':class' => 'pager')); $this->assertTrue(!empty($elements), 'Individual source page contains a pager.'); + // Check for sources page title. + $this->drupalGet('aggregator/sources'); + $titles = $this->xpath('//h1[normalize-space(text())=:title]', array(':title' => 'Sources')); + $this->assertTrue(!empty($titles), 'Source page contains correct title.'); + + // Find the expected read_more link on the sources page. + $href = 'aggregator/sources/' . $feed->id(); + $links = $this->xpath('//a[@href = :href]', array(':href' => url($href))); + $this->assert(isset($links[0]), format_string('Link to href %href found.', array('%href' => $href))); + // Check for the presence of a pager. $this->drupalGet('aggregator/sources/' . $feed->id()); $elements = $this->xpath("//ul[@class=:class]", array(':class' => 'pager'));