I'm getting the following warnings on nodes where the node's content type does not have any user reference fields assigned.
WARNING OCCURS ONLY ON PREVIEW PAGE.. Also, ADMIN user does not receive the warning. If user skips Preview and simply save node, user does not receive the warning.
Warning: Illegal offset type in isset or empty in nodeaccess_userreference_node_access() (line 401 of /Users/cale/Sites/acquia-drupal/sites/all/modules/nodeaccess_userreference/nodeaccess_userreference.module).
references to related threads:
http://drupal.org/node/1262788
http://drupal.org/node/1198498
Comments
Comment #1
danielb commentedAre you using i18n ?
#1262800: node_access in i18n_node: ('create', $node) or ('create', $node->type) or ('update', $node)
If not some other module or core is calling node_access('create', $node) which is incorrect according to the API documentation for node_access() which says that when the $op is 'create' the 2nd param should be a string containing the node type.
Comment #2
calefilm commentedNo. But thanks for the response. When I can find out I will report back.
Comment #3
danielb commentedYou could probably debug that bit of code where the error happens, if the op is 'create' but is_object($node) is TRUE, get the data from debug_backtrace() to see who is calling node_access()
Comment #4
calefilm commentedWould that be using devel? I just downloaded the module but forgot how to implement backtrace as I was instructed once before on how to do it. Are there simple instructions you can refer me to on drupal to do a backtrace? Thanks
Comment #5
danielb commenteddebug_backtrace() is a PHP function that returns an array of data so you can figure out what called the current function, and what called that, and so on... However, it returns way too much info than you usually need, so you need to carefully pick through it, or only output a small portion of it to prevent problems with the page loading.
There might be helpful stuff in devel to do it, but I'm not aware.
off the top of my head...
you might have to go back a few steps to see which code is calling the function node_access().
Comment #6
calefilm commentedI entered the code you suggested but in order to see anything I had to give devel permissions to my member users (i'm using localhost) in order to see the error and get the array to show.. Am I doing it right so far? I don't know what I'm looking for either.. But kinda feel i'm not doing it the right way. I don't know if the array is identifying the error above in red.
Array 2 Elements:
Array 4 elements:
Comment #7
danielb commentedbugger it, i'll just patch the function to accept node object
Comment #8
danielb commentedshould be right now
Comment #9
calefilm commentedsorry to bring more problem news but after updating to dev now I have this issue: http://drupal.org/node/1689886
Comment #10.0
(not verified) commentededit