Prevent fatal error if revision belongs to anonymous user.

Created on 12 August 2025, 4 days ago

Problem/Motivation

Need diff to work if a revision belongs to the anonymous author.

This appears to be related to an issue that was fixed at some point in the 2.x branch (see the closed issue https://www.drupal.org/project/diff/issues/3088274 πŸ› Prevent fatal error if the revision has no author Needs work ).

Steps to reproduce

Change owner of a node revision to the anonymous user (UID=0), then try to make a diff.
The error that returns is Error: Call to a member function getDisplayName() on null in Drupal\diff\DiffLayoutBase->buildRevisionData() (line 189 of /opt/drupal/web/modules/contrib/diff/src/DiffLayoutBase.php).

In my case, the user who had created the node was deleted and its content assigned to the anonymous user. Another user then edited the node. When trying to diff the two I get the error.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

1.9

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States kwfinken Lansing, MI

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

Comments & Activities

Production build 0.71.5 2024