Problem/Motivation

In Drupal 10.2.2, when rebuilding permissions, I receive this error:
Error: Call to a member function isAuthenticated() on null in nodeaccess_node_access_records() (line 39 of /app/web/modules/contrib/nodeaccess/nodeaccess.module).

Steps to reproduce

Go to /admin/reports/status and scroll down to Node Access Permissions. There is a link 'Rebuild permissions'. Click on it. This fails to rebuild and logs the error above in the logs.

Issue fork nodeaccess-3418933

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

SiliconValet created an issue. See original summary.

siliconvalet’s picture

Patch to address "Call to a member function isAuthenticated() on null"

- if ($node->getOwner()->isAuthenticated()) {
+ if ($node->getOwner() && $node->getOwner()->isAuthenticated()) {

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

abhishek_gupta1’s picture

Status: Active » Reviewed & tested by the community

i applied Patch #2. its working for me. also created MR.

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

doxigo’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, this is merged.

doxigo’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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