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
Issue fork rdf-3307283
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:
- 3307283-restate-deleted-views
changes, plain diff MR !6
Comments
Comment #2
spokjeComment #3
phenaproximaI think I know a way to do this.
Comment #5
spokjeComment #6
phenaproximaAlright, 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:
This shows that Views really expects themes to allow injection of additional namespaces.
Comment #7
spokjeLet's see if TestBot hates this slightly less if we feed it the plain diff from the MR.
Comment #9
spokje@phenaproxima Looks like this needs some polishing, but I like where this is going :)
Comment #10
bbralaThis 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)
Comment #11
phenaproximaTests pass on my localhost on 9.5.x and 10.0.x. How about for you, @Spokje and @bbrala?
Comment #12
longwaveThe 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).
Comment #13
phenaproximaThis sounds extremely plausible to me.
Comment #14
longwaveIt'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-rdfand 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.Comment #15
longwaveMarking this as RTBC anyway as the code changes here look good to me, and the CI issue is unrelated to this fix.
Comment #16
bbralaThanks everyone, tested locally, and tests are now green. :)