The "Content" (nid) relationship on a view of node revisions gets off and joins to the wrong nodes. Here are steps to reproduce:

  • Install Drupal using the Standard install profile.
  • Import the attached view, which is a simple display of the latest 10 revisions with node title and ID (nid), directly from the revisions and via a relationship to the content, respectively.
  • Create an article. (Save and publish.)
  • Create a new revision on that article. (Save and keep published.)
  • Create a Basic page. (Save and publish.)
  • Create a new revision on that basic page. (Save and keep published.)
  • Visit the test view (/test), and you will see that for the last two created revisions the title and nid from the content relationship do not match the title and nid from the revisions directly.

Here's the result for me. I have emphasized the discrepancies to highlight the issue.

Revision title Relationship title Revision nid Relationship nid Revision vid
Basic page, second revision Article, second revision 2 1 4
Basic page, first revision Article, second revision 2 1 3
Article, second revision Article, first revision 1 1 2
Article, first revision Article, first revision 1 1 1
CommentFileSizeAuthor
views.view_.test.yml12.63 KBtraviscarden

Comments

TravisCarden created an issue. See original summary.

dawehner’s picture

This sounds really similar to #2714989: Views which load the same entity type as entity and non default revision cause fatal in Sql::getCacheTags() to be honest, it would be great if you could test the patch on that issue.

dawehner’s picture

By reading your description this could be totally caused by the wrong way how we load entities and revisions. Given that I feel quite positive that the other issue resolves your problem.

traviscarden’s picture

Status: Active » Fixed

Thanks, @dawehner. The patch in #2714989-14: Views which load the same entity type as entity and non default revision cause fatal in Sql::getCacheTags() sure seems to fix this problem. Marking fixed. Thanks!!

Status: Fixed » Closed (fixed)

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