Although this should be an edge case, in our current project we get a WSOD on the /admin/content/message page because some of the users that created a message are deleted from the database, maybe as a result of syncing databases over different server in our OTAP.

The generated error is:

The website encountered an unexpected error. Please try again later.
Error: Call to a member function label() on null in Drupal\message\MessageListBuilder->buildRow() (line 93 of modules/contrib/message/src/MessageListBuilder.php).

I will include a patch that resolves the issue, but maybe this error should not occur in 'normal' situations.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

louisnagtegaal created an issue. See original summary.

louisnagtegaal’s picture

louisnagtegaal’s picture

Issue summary: View changes
louisnagtegaal’s picture

Issue summary: View changes
maaty388’s picture

Remember to set status to needs review after submitting patch

maaty388’s picture

Status: Active » Needs review
maaty388’s picture

This patch is working for me

maaty388’s picture

Status: Needs review » Reviewed & tested by the community

jhedstrom’s picture

Status: Reviewed & tested by the community » Fixed

Awesome, thanks!

+++ b/src/MessageListBuilder.php
@@ -90,7 +90,7 @@ class MessageListBuilder extends EntityListBuilder {
+      'author' => (!empty($entity->getOwner())) ? $entity->getOwner()->label() : t('Anonymous'),

Changed on commit to use $this->t().

Status: Fixed » Closed (fixed)

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