Problem/Motivation

In the event of a note owner being removed, the note list can cause an error.

Error: Call to a member function getDisplayName() on null in template_preprocess_moderation_note() (line 324 of /app/docroot/modules/contrib/moderation_note/moderation_note.module)

Steps to reproduce

Add a note from one author, then remove the author user from the CMS.

Proposed resolution

Add a more defensive if clause around the owner, this would be the same as the assignee logic.

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:

Comments

andy_w created an issue. See original summary.

andy_w’s picture

Status: Active » Needs review
StatusFileSize
new1017 bytes
andy_w’s picture

StatusFileSize
new3.14 KB

Check for note owner in access control handler as well as moderation note preprocessor.

bluegeek9 made their first commit to this issue’s fork.

  • andy_w authored e48238be on 8.x-1.x
    Issue #3225665 by andy_w: In the event of a note owner being removed,...
bluegeek9’s picture

Status: Needs review » Fixed

Hi andy_w,

Thank you for your contribution to the project!

Status: Fixed » Closed (fixed)

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