Commit c432629f authored by Dries's avatar Dries
Browse files

Issue #1903410 by dawehner: Fixed Wrong config key is used in template_preprocess_views_view_rss().

parent a3d1bee7
......@@ -52,7 +52,7 @@ public function testFeedUI() {
$this->drupalGet('admin/structure/views');
// Check the attach TO interface.
$this->drupalGet('admin/structure/views/nojs/display/test_feed_display/feed/displays');
$this->drupalGet('admin/structure/views/nojs/display/test_feed_display/feed_1/displays');
// Load all the options of the checkbox.
$result = $this->xpath('//div[@id="edit-displays"]/div');
......@@ -68,14 +68,39 @@ public function testFeedUI() {
$this->assertEqual($options, array('default', 'page'), 'Make sure all displays appears as expected.');
// Post and save this and check the output.
$this->drupalPost('admin/structure/views/nojs/display/test_feed_display/feed/displays', array('displays[page]' => 'page'), t('Apply'));
$this->drupalGet('admin/structure/views/view/test_feed_display/edit/feed');
$this->assertFieldByXpath('//*[@id="views-feed-displays"]', 'Page');
$this->drupalPost('admin/structure/views/nojs/display/test_feed_display/feed_1/displays', array('displays[page]' => 'page'), t('Apply'));
$this->drupalGet('admin/structure/views/view/test_feed_display/edit/feed_1');
$this->assertFieldByXpath('//*[@id="views-feed-1-displays"]', 'Page');
// Add the default display, so there should now be multiple displays.
$this->drupalPost('admin/structure/views/nojs/display/test_feed_display/feed/displays', array('displays[default]' => 'default'), t('Apply'));
$this->drupalGet('admin/structure/views/view/test_feed_display/edit/feed');
$this->assertFieldByXpath('//*[@id="views-feed-displays"]', 'Multiple displays');
$this->drupalPost('admin/structure/views/nojs/display/test_feed_display/feed_1/displays', array('displays[default]' => 'default'), t('Apply'));
$this->drupalGet('admin/structure/views/view/test_feed_display/edit/feed_1');
$this->assertFieldByXpath('//*[@id="views-feed-1-displays"]', 'Multiple displays');
}
/**
* Tests the rendered output.
*/
public function testFeedOutput() {
$this->drupalCreateNode();
// Test the site name setting.
$site_name = $this->randomName();
$this->container->get('config.factory')->get('system.site')->set('name', $site_name)->save();
$this->drupalGet('test-feed-display.xml');
$result = $this->xpath('//title');
$this->assertEqual($result[0], $site_name, 'The site title is used for the feed title.');
$views = $this->container->get('plugin.manager.entity')->getStorageController('view')->load(array('test_feed_display'));
$view = array_pop($views);
$display = &$view->getDisplay('feed_1');
$display['display_options']['sitename_title'] = 0;
$view->save();
$this->drupalGet('test-feed-display.xml');
$result = $this->xpath('//title');
$this->assertEqual($result[0], 'test_feed_display', 'The display title is used for the feed title.');
}
}
......@@ -66,7 +66,7 @@ display:
display_title: Master
id: default
position: '0'
feed:
feed_1:
display_options:
displays: { }
pager:
......@@ -76,9 +76,10 @@ display:
type: node_rss
style:
type: rss
sitename_title: '1'
display_plugin: feed
display_title: Feed
id: feed
id: feed_1
position: '0'
page:
display_options:
......
......@@ -877,7 +877,7 @@ function template_preprocess_views_view_rss(&$vars) {
$vars['description'] = check_plain(decode_entities(strip_tags($style->get_description())));
if ($view->display_handler->getOption('sitename_title')) {
$title = $config->id();
$title = $config->get('name');
if ($slogan = $config->get('slogan')) {
$title .= ' - ' . $slogan;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment