Closed (fixed)
Project:
Drupal core
Version:
9.5.x-dev
Component:
rdf.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
1 Sep 2022 at 06:51 UTC
Updated:
17 Jul 2026 at 09:02 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #4
catchComment #5
bbralaWhile contemplating a test only patch i see an issue. The new code overwrites the existing namespaces in the views_plugin because it hooks into node (
rdf_node_build_defaults_alter). While the original code gets the namespaces and only overwrites the namespaces that do not exist.The tag was introduced here in views: #808230: Problems with XML namespace and dc:creator tag
When I look at the offical spec the namespace 'http://purl.org/dc/terms/' is a superset of the 'http://purl.org/dc/elements/1.1/'. But the fact is, the patch changes the namespace. Even though its compatible, we cannot just change the namespace definition..
See https://www.dublincore.org/specifications/dublin-core/dcmi-terms/
So the problem seems to be. In the standard logic array merge is used:
Drupal\node\Plugin\views\row\Rss:line 124: $this->view->style_plugin->namespaces = array_merge($this->view->style_plugin->namespaces, $node->rss_namespaces);And in the rdf specific method an operator:
line 131: $this->view->style_plugin->namespaces += $xml_rdf_namespaces;So the current patch's logic that adds the namespaces to the node results in a different result unfortunately.
For reference and context the commit in RDF module: https://git.drupalcode.org/project/rdf/-/commit/e738017f4b8a7dc1e51a4864f5203461dde91f5e
My end plan (verified with @catch) is to ignore the namespace views is adding in the test and while adding namespaces to node. This seems to work fine.
Adding the following patches:
33207230-testonly.patch: Only add the new test for the integration (should be green).33207230-test-remove-integration.patch: Remove the integration (should fail)33207230-integrate-hook-in-rdf.patch: Add the new solution (should be green again)Ill push the latest patch to the MR also (
33207230-integrate-hook-in-rdf.patch).Comment #6
bbralaAlso created #3307246: Integration of views is a little broken to add these changes to RDF cin contrib if needed.
Comment #8
bbralaGmbrl, forgot to do my codestyle check.
Comment #9
bbralaThe fail is expected, testonly green, and patches green :D
Comment #10
spokjeGreen patches where green patches should be.
Red patch where red was expected.
Change was blessed by @catch (https://drupal.slack.com/archives/C014CT1CN1M/p1662020110101769?thread_t...).
Code makes sense.
RTBC for me.
Notes:
1. Patch to commit is
33207230-8-integrate-hook-in-rdf.patch.2. Please add credit to @phenaproxima for being the mastermind behind this all.INSTA-EDIT on 2. Credit was already added.
Comment #12
catchCommitted/pushed to 10.1.x, cherry-picked to 10.0.x and 9.5.x, thanks!