Skip to content
Snippets Groups Projects

Issue #1337894: Apply patch from comment 39 (authored by neclimdul, omegadela, fengtan)

Open Issue #1337894: Apply patch from comment 39 (authored by neclimdul, omegadela, fengtan)
Open Eric Smith requested to merge issue/drupal-1337894:1337894-views-rss-feeds into 11.x
2 files
+ 20
3
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -99,7 +99,19 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
* A render array.
*/
protected function getChannelElements() {
return [];
$url = $this->view->getUrl()->setAbsolute()->toString();
return [
[
'namespace' => ['xmlns:atom' => 'http://www.w3.org/2005/Atom'],
'#type' => 'html_tag',
'#tag' => 'atom:link',
'#attributes' => [
'href' => $url,
'rel' => 'self',
'type' => 'application/rss+xml',
],
],
];
}
/**
@@ -130,9 +142,10 @@ public function render() {
// Fetch any additional elements for the channel and merge in their
// namespaces.
$this->channel_elements = $this->getChannelElements();
foreach ($this->channel_elements as $element) {
foreach ($this->channel_elements as &$element) {
if (isset($element['namespace'])) {
$this->namespaces = array_merge($this->namespaces, $element['namespace']);
unset($element['namespace']);
}
}
Loading