Problem/Motivation

In #3267515-26: Remove RDF from core we ended up deleting this bit of code from \Drupal\views\Plugin\views\row\RssFields

    if (function_exists('rdf_get_namespaces')) {
      // Merge RDF namespaces in the XML namespaces in case they are used
      // further in the RSS content.
      $xml_rdf_namespaces = [];
      foreach (rdf_get_namespaces() as $prefix => $uri) {
        $xml_rdf_namespaces['xmlns:' . $prefix] = $uri;
      }
      $this->view->style_plugin->namespaces += $xml_rdf_namespaces;
    }

I'm sure the clever people in here find a way to reincorporate this bit of code in the Contrib module.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#7 6.diff32.99 KBspokje

Issue fork rdf-3307283

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Spokje created an issue. See original summary.

spokje’s picture

Issue summary: View changes
phenaproxima’s picture

Assigned: Unassigned » phenaproxima

I think I know a way to do this.

spokje’s picture

Title: Restate deleted Views RSSField integration » Reinstate deleted Views RSSField integration
phenaproxima’s picture

Status: Active » Needs review

Alright, this should fix it.

This should also cover all bases (and I'm proving it with the added test coverage) -- RSS feeds generated using Node's RSS plugin, and RSS feeds that use Views' generic RSS fields plugin.

I had to do it at the theme layer, injecting the namespaces in a preprocess function. I think that makes sense, though, since views-view-rss.html.twig has this line:

<rss version="2.0" xml:base="{{ link }}"{{ namespaces }}>

This shows that Views really expects themes to allow injection of additional namespaces.

spokje’s picture

StatusFileSize
new32.99 KB

Let's see if TestBot hates this slightly less if we feed it the plain diff from the MR.

Status: Needs review » Needs work

The last submitted patch, 7: 6.diff, failed testing. View results

spokje’s picture

@phenaproxima Looks like this needs some polishing, but I like where this is going :)

bbrala’s picture

This went wrong in the last issue regarding views, lets make sure it doesnt happen here: #3307230: Backport RDF/views integration changes to 9.5.x

(and the rdf issue: #3307246: Integration of views is a little broken)

phenaproxima’s picture

Status: Needs work » Needs review

Tests pass on my localhost on 9.5.x and 10.0.x. How about for you, @Spokje and @bbrala?

longwave’s picture

The tests also pass for me locally on both 9.5.x and 10.0.x. I don't see why the view is 404 on DrupalCI. Requeued #7 on 10.0,x just in case 9.5.x is at fault somehow - the only thing I could think of is that it is installing the wrong rdf_test_namespaces module somehow (the one that's still shipped with 9.5.x, but is now removed from 10.0.x).

phenaproxima’s picture

the only thing I could think of is that it is installing the wrong rdf_test_namespaces module

This sounds extremely plausible to me.

longwave’s picture

It's not quite what I thought. Instead I think the problem is #3307008: Ensure RDF does not get special core treatment - DrupalCI thinks the module is drupal/rdf-rdf and so it installs that for both the MR and the patch tests. The MR fails to install at all, and for the patch somehow the patch is applied but it's picking up the wrong (unpatched) version from somewhere still.

longwave’s picture

Status: Needs review » Reviewed & tested by the community

Marking this as RTBC anyway as the code changes here look good to me, and the CI issue is unrelated to this fix.

bbrala’s picture

Status: Reviewed & tested by the community » Fixed

Thanks everyone, tested locally, and tests are now green. :)

  • bbrala committed c92ff6b on 2.x
    Issue #3307283 by phenaproxima, Spokje, longwave, bbrala: Reinstate...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.