Problem/Motivation
TypeError: Argument 1 passed to Drupal\Core\Entity\EntityViewBuilder::view() must implement interface Drupal\Core\Entity\EntityInterface, null given, called in core/modules/node/node.module on line 559
Issue fork drupal-3278883
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
Comment #3
vhin0210 commentedComment #4
larowlanThis shouldn't happen, as the author field has a default value.
Can you provide steps to reproduce this starting from 'install drupal'
Thanks
Comment #7
longwaveRan into this on an existing large site; this was a database integrity issue for me. Some nodes were somehow owned by deleted users, when rendering them in a search result I saw the same error.
As getOwner() can return NULL (even though it is not documented as such) I think we should provide protection against this.
Comment #8
longwaveThis also reminds me that all these historic theme settings should just be configured in the entity display.
Comment #12
catchSeems OK to be more defensive here, there are other ways to find out the node owner has been deleted that aren't fatal errors for site visitors.
Committed/pushed to 11.x and cherry-picked back through to 9.5.x, thanks!