Unverified Commit acb621d0 authored by Lee Rowlands's avatar Lee Rowlands
Browse files

Issue #3048848 by jmikii, carletex, andypost, sulfikar_s, mrinalini9,...

Issue #3048848 by jmikii, carletex, andypost, sulfikar_s, mrinalini9, himanshu_sindhwani, anantjain60, guilhermevp, johnwebdev, alexpott, quietone: Syndicate block outputs wrong feed URL
parent 49eb106b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Block\BlockBase;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Url;

/**
 * Provides a 'Syndicate' block that links to the site's RSS feed.
@@ -39,7 +40,7 @@ protected function blockAccess(AccountInterface $account) {
  public function build() {
    return [
      '#theme' => 'feed_icon',
      '#url' => 'rss.xml',
      '#url' => Url::fromUri('internal:/rss.xml'),
    ];
  }

+4 −0
Original line number Diff line number Diff line
@@ -37,6 +37,10 @@ public function testSyndicateBlock() {
    $this->drupalPlaceBlock('node_syndicate_block', ['id' => 'test_syndicate_block']);
    $this->drupalGet('');
    $this->assertSession()->elementExists('xpath', '//div[@id="block-test-syndicate-block"]/*');
    // Tests the syndicate block RSS link rendered at non-front pages.
    $this->drupalGet('user');
    $this->clickLink('Subscribe to');
    $this->assertSession()->addressEquals('rss.xml');
  }

}