Revisions list only shows the current revision

Created on 11 November 2022, almost 2 years ago
Updated 28 July 2024, about 1 month ago

Problem/Motivation

Since version 9.3.8 our site has exhibited strange behaviour in that when a user goes to the revisions tab of a node, regardless of how many revisions there are only the current revision is listed. I've tried it out on a clean install and the revisions list is fine, I've also disabled all of our custom modules and the revisions list is still broken.

It's not drupal core and it's not our custom code so I can only assume that it's a contributed module that may be hijacking the $node_storage->getQuery() command. I can fix it by editing:

core/modules/node/src/Controller/NodeController.php

...but core is not where the problem is so a patch (attached) would not be my first choice. Has anyone else seen this behaviour and, if so, can it be fixed?

Steps to reproduce

Difficult to pin down what's causing it. It's clearly not core and it doesn't look like it's our custom modules. A list of contrib modules is attached, FWIW.

Proposed resolution

As you will see from the patch, \Drupal::entityTypeManager()->getStorage('node')->revisionIds($node) will return all revisions whereas the original $node_storage->getQuery() will only return the most recent revision. Again, I'm not proposing this as a patch for drupal core, it's just to illustrate where the problem lies.

Something is causing NodeInterfaceStorage getQuery() to return only one revision while \Drupal::entityTypeManager()->getStorage('node')->revisionIds($node) works as expected (cross-checked against the node_revision table in the database). Any insight would be much appreciated.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ’¬ Support request
Status

Closed: outdated

Version

11.0 πŸ”₯

Component
Node systemΒ  β†’

Last updated 1 minute ago

No maintainer
Created by

πŸ‡¬πŸ‡§United Kingdom dylanb

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡­πŸ‡°Hong Kong hameedbs

    I have the same issue which I am getting now. My drupal version is 9.5.2

    The patch you had provided and the actual code give back the same result. ie the revision ids except your patch sorts the array.

    So my guess is that the issues is not with the PHP code but may be with the twig file?

    Thanks for light.

  • Status changed to Postponed: needs info about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States cilefen

    Is there an update on this one?

  • Status changed to Closed: outdated about 1 month ago
  • πŸ‡ΊπŸ‡ΈUnited States cilefen
Production build 0.71.5 2024