Greetings,

I see that something similar to this issue has occurred in the past, but apparently not recently. On loading pages I am presented with the following error:

Notice: Trying to get property of non-object in nodeaccess_password_node_access_explain() (line 241 of /var/www/html/sites/all/modules/nodeaccess_password/nodeaccess_password.node.inc).

In looking at line 241, it appears, possibly, that the 'name' in the $account->name statement might be offending some sensibilities in my install:

 if (!empty($ops)) {
      $do = implode('/', $ops);
      if ($row->realm == 'nodeaccess_password_author') {
        $account = user_load($row->gid);
        return t(
          'Node author %name may !do this node',
          array(
  <strong>          '%name' => $account->name,</strong> (Line 241)
            '!do' => $do,

Does anyone know of some underlying something or other that would be responsible for this? I only had one issue that Drupal balked about in my PHP setup, which was that it wanted mbstring installed, so I did that, but still get the error message. Drupal is running on a Centos 6.x system.

Comments

kduryee’s picture

Anyone there?

beltofte’s picture

Try disabling the devel node access module. That module is using this hook. Looks like the problem is caused, because it tries to load a user using the grant id from the realm. The problem is that the user will not get loaded, because grant id (gid) is in this module not the user id, but instead the node id.

I will try to create a patch later today or in the weekend.

beltofte’s picture

Assigned: Unassigned » beltofte
Category: support » bug
beltofte’s picture

Status: Active » Needs review
StatusFileSize
new1.08 KB

The attached patch should solve this if I understand the node access implementation correct ;-)

kduryee’s picture

Status: Needs review » Active

Sorry I haven't checked this in quite awhile, but the patch works like a charm - no more error messages. Thank you very much! I don't know whether I'm supposed to close this, but I would say that the issue is definitely fixed by the patch. Thanks again.

beltofte’s picture

Status: Active » Reviewed & tested by the community

Super, that it solved the problem. Lets leave it open till it has been committed. The maintainer is not so active anymore and looking for new maintainers. I have send a request to the Drupal.org webmaster to become maintainer on this project. Will hopefully get it soon, so I can commit this and other patches in the issue queue.

beltofte’s picture

Status: Reviewed & tested by the community » Fixed

Comitted to git :-)

Status: Fixed » Closed (fixed)

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