Problem/Motivation

When viewing node revision I get the following error:

TypeError: Argument 1 passed to Drupal\Core\Entity\EntityRepository::getTranslationFromContext() must implement interface Drupal\Core\Entity\EntityInterface, null given, called in /var/www/html/docroot/modules/contrib/rocketship_core/src/Plugin/Field/FieldFormatter/ContentBlockTitleReplacementFormatter.php on line 157 in Drupal\Core\Entity\EntityRepository->getTranslationFromContext() (line 93 of core/lib/Drupal/Core/Entity/EntityRepository.php).

Steps to reproduce

I think the problem exists for Drupal 9.3 and above.

Go to the detail page of any node revision with the title inline block.

Proposed resolution

node_revision is now a revision object when getting it from the route. Let's add an extra check.

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nginex created an issue. See original summary.

nginex’s picture

Assigned: nginex » Unassigned
Status: Active » Needs review

  • nginex committed fd35b9e on 6.x
    Issue #3292138: Fatal error in ContentBlockTitleReplacementFormatter for...
nginex’s picture

Version: 6.0.0-alpha38 » 6.x-dev
Status: Needs review » Fixed

The patch fixes the issues on revision detail page.

Status: Fixed » Closed (fixed)

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