Commit c636cccc authored by catch's avatar catch
Browse files

Issue #3273876 by mfb, smustgrave: Aggregator page contents could be empty due...

Issue #3273876 by mfb, smustgrave: Aggregator page contents could be empty due to missing cache context
parent 26a15a09
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -73,8 +73,8 @@ protected function buildPageList(array $items, $feed_source = '') {
    if ($items) {
      $build['items'] = $this->entityTypeManager()->getViewBuilder('aggregator_item')
        ->viewMultiple($items, 'default');
      $build['pager'] = ['#type' => 'pager'];
    }
    $build['pager'] = ['#type' => 'pager'];
    return $build;
  }

+2 −0
Original line number Diff line number Diff line
@@ -103,6 +103,8 @@ public function testFeedPage() {
    $feed = $this->createFeed();
    $this->updateFeedItems($feed, 30);

    // Request page with no feed items to ensure cache context is set correctly.
    $this->drupalGet('aggregator', ['query' => ['page' => 2]]);
    // Check for presence of an aggregator pager.
    $this->drupalGet('aggregator');
    $this->assertSession()->elementExists('xpath', '//ul[contains(@class, "pager__items")]');