When logged in with other than administrator, or anonymous, there's a notice in a red box :
Notice : Trying to get property of non-object in node_node_access() (ligne 2923 in [drupal root]/modules/node/node.module).

Is it an authorization error from my own installation ?

CommentFileSizeAuthor
Capture.png97.72 KBicefinger

Comments

icefinger’s picture

Assigned: icefinger » Unassigned
Anonymous’s picture

Status: Active » Closed (cannot reproduce)

This must be the result of a contrib module installed on the site because it would have affected many sites if it were a bug in core.

g.basle’s picture

Hello,

I have exactly the same problem but with the 7.12 version of Drupal. The notice in the red box said :
Trying to get property of non-object in node_node_access() (line 2932 of C:\wamp\www\drupal-7.12\modules\node\node.module).

In line 2932 in modules\node\node.module :

/**
 * Implements hook_node_access().
 */
function node_node_access($node, $op, $account) {
  $type = is_string($node) ? $node : $node->type;

  if (in_array($type, node_permissions_get_configured_types())) {
    if ($op == 'create' && user_access('create ' . $type . ' content', $account)) {
      return NODE_ACCESS_ALLOW;
    }

    if ($op == 'update') {
      if (user_access('edit any ' . $type . ' content', $account) || (user_access('edit own ' . $type . ' content', $account) && ($account->uid == $node->uid))) {
        return NODE_ACCESS_ALLOW;
      }
    }

    if ($op == 'delete') {
      if (user_access('delete any ' . $type . ' content', $account) || (user_access('delete own ' . $type . ' content', $account) && ($account->uid == $node->uid))) {
        return NODE_ACCESS_ALLOW;
      }
    }
  }

  return NODE_ACCESS_IGNORE;
}

Does anyone know how to solve this problem ?

Thanks

hkvega01’s picture

//$type = is_string($node) ? $node : $node->type;
if (is_string($node)) {
$type = $node;
} else {
if (is_object($node)) {
$type = $node->type;
} else {
$type = $node;
}
}

i changed the code temporarily fixed it, but i don't sure it has some hidden bug.