I created a View for my custom Paragraph structure that contains Date and Location, which is field on a custom Content Type. In the view, I added the relationship that pulls in the Content that relates to the Paragraph. Theoretically, this should result in a view that displays all of my Nodes that have a Date and Location paragraph field filled out.
Unfortunately, there seems to be a bug with pulling in the correct Node related to the Date and Location Paragraph. When I print out the results in the hook_views_post_execute
hook, I get the following results:
Array (
[0] => DrupalviewsResultRow Object: (
[_entity] => DrupalparagraphsEntityParagraph Object: (
...
[values] => Array (
...
[parent_id] => 604,
...
)
),
[_relationship_entities] => Array (
[reverse__node__field_date_and_location] => DrupalnodeEntityNode Object (
...
[values] => Array (
...
[nid] => 499,
[vid] => 604,
...
)
)
)
)
...
)
The parent_id
of the Paragraph is 604
, however, the relationship entity (the node) that is loaded with the Paragraph is a Node with an Id of 499
. It seems like the view is using the paragraph’s parent_id
to load the relating node by vid
instead of nid
…
Why is my view loading the incorrect and how can I fix it?