Problem/Motivation
#3307138: Move core's Views integration into this module was fixed in contrib RDF, but not in core RDF in 9.5.x, we should make the same changes in 9.5 and remove the integration from Views in 9.5 too.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 33207230-8-integrate-hook-in-rdf.patch | 8.69 KB | bbrala |
| #8 | interdiff-test-remove-integration-6-8.txt | 611 bytes | bbrala |
| #8 | interdiff-testonly-6-8.txt | 611 bytes | bbrala |
| #8 | interdiff-integrate-hook-in-rdf-6-8.txt | 993 bytes | bbrala |
| #8 | 33207230-8-test-remove-integration.patch | 7.63 KB | bbrala |
Issue fork drupal-3307230
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
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!