Problem/Motivation

For anonymous users, seeing this issue,

Error: Call to a member function getEntity() on null in node_co_authors_entity_field_access() (line 146 of /var/www/html/docroot/modules/contrib/node_co_authors/node_co_authors.module).

Steps to reproduce

  1. Enable module & create couple of article type content with co-authors.
  2. Create a view, showing title, author & co-author and Add filters of Co-author.
  3. For authenticated users, its working fine. But for anonymous user seeing the error & page is broken.

Proposed resolution

Fix & create a patch

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

heykarthikwithu created an issue. See original summary.

sarwan_verma’s picture

Assigned: Unassigned » sarwan_verma

shreya_th’s picture

Assigned: sarwan_verma » Unassigned
Status: Active » Needs review
dieterholvoet’s picture

Assigned: Unassigned » dieterholvoet
Status: Needs review » Needs work

@sarwan_verma I highly doubt you tested that change: on the next line $entity->getOwnerId() is called, which will throw another error if $entity is NULL. I'm not granting credit for this.

dieterholvoet’s picture

dieterholvoet’s picture

Status: Needs work » Fixed

Thanks for reporting!

dieterholvoet’s picture

Status: Fixed » Closed (fixed)

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