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

Issue fork drupal-3307230

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

catch created an issue. See original summary.

bbrala made their first commit to this issue’s fork.

catch’s picture

bbrala’s picture

While 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).

bbrala’s picture

Also created #3307246: Integration of views is a little broken to add these changes to RDF cin contrib if needed.

bbrala’s picture

Gmbrl, forgot to do my codestyle check.

bbrala’s picture

Status: Active » Needs review

The fail is expected, testonly green, and patches green :D

spokje’s picture

Status: Needs review » Reviewed & tested by the community

Green 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.

  • catch committed 3784f13 on 10.1.x
    Issue #3307230 by bbrala, catch, phenaproxima, Spokje: Backport RDF/...
  • catch committed 0093496 on 9.5.x
    Issue #3307230 by bbrala, catch, phenaproxima, Spokje: Backport RDF/...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 10.1.x, cherry-picked to 10.0.x and 9.5.x, thanks!

  • catch committed ac08f28 on 10.0.x
    Issue #3307230 by bbrala, catch, phenaproxima, Spokje: Backport RDF/...

Status: Fixed » Closed (fixed)

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