NCIOCPL / cgov-digital-platform

The Cancer.gov Digital Communications Platform
GNU General Public License v2.0
12 stars 33 forks source link

Show revisions in moderation sidebar fails if user has been deleted #4451

Open jfrank-nih opened 2 months ago

jfrank-nih commented 2 months ago

Issue description

If the node has a revision whose authoring user has been deleted from Drupal then clicking on the "Show revisions" button results in an error:

Oops, something went wrong. Check your browser's developer console for more details.

The browser console says:

An AJAX HTTP error occurred.
HTTP Result Code: 503
Debugging information follows.
Path: /moderation_sidebar/node//revisions?latest=1

And the PHP error says:

Uncaught PHP Exception Error: "Call to a member function getDisplayName() on null" at /mnt/www/html//docroot/modules/contrib/moderation_sidebar/src/Controller/ModerationSidebarController.php

In our codebase line 374 is:

'#revision_author' => $user->getDisplayName(),

ESTIMATE TBD

Steps to reproduce the issue

  1. Pick a node with multiple revisions from multiple authors, then choose one author to delete (note: it has to be an author in the top few revisions that is displayed in moderation sidebar by default)
  2. Go to People Administration, find that user, edit them, and then choose "Cancel account"
  3. On the cancellation page, choose the option "Delete the account and make its content belong to the Anonymous user. This action cannot be undone."

What's the expected result?

What's the actual result?

Additional details / screenshot

Related Tickets

jfrank-nih commented 2 months ago

Probably just wait until they patch this one. Hopefully... unless we want to submit a patch.