Revision object is returned instead of revision id due to core type upcasting change.

Created on 12 September 2023, almost 2 years ago
Updated 21 June 2024, about 1 year ago

Problem/Motivation

Drupal core 9.3 updated the typecasting for the node_revision route parameter which means it's a fully fledged object now. The code in this module for getting the entity is using code that thinks it's the revision id, a numeric value, which then throw this error:

TypeError: Illegal offset type in Drupal\Core\Entity\ContentEntityStorageBase->loadRevision() (line 636 of core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php).

Steps to reproduce

  1. Install the module
  2. Create a node with revisions
  3. Click on the Revisions tab, click to view one of the revisions, observe WSOD

Proposed resolution

See attached patch.

Remaining tasks

User testing

🐛 Bug report
Status

RTBC

Version

1.0

Component

Code

Created by

🇮🇳India sahilgidwani Jaipur

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

Comments & Activities

Production build 0.71.5 2024