I am getting this error installing this module on a fresh site using entity reference.

Notice: Undefined index: referenced in nodeaccess_nodereference_check_cross_access() (line 596 of /Users/me/Sites/mysite/htdocs/sites/all/modules/nodeaccess_nodereference/nodeaccess_nodereference.module).

It just keeps piling on the more I configure the content type using an entity reference for a user.

Comments

mariusz.slonina’s picture

Same with references 7.x-2.0

danielb’s picture

Can't replicate the problem. Steps to reproduce?

KHofmeyer’s picture

I get this even if I just install a fresh drupal seven with the basic features. Install this module and entity reference. Create a field on a node as a reference and once I click save to configure the field this error occurs. It then just keeps adding up if I save the content type with other fields and create content from the content type. This is also happening in the nodeaccess_userreference module for me as well.

Sylense’s picture

Same

danielb’s picture

Status: Active » Postponed (maintainer needs more info)

I don't see how 'referenced' can be an undefined index. I've been debugging the variable, while creating fields and nodes, and 'referenced' is always there.
Please provide more information.

danielb’s picture

I get a PDO exception, lol, but I don't get this.

danielb’s picture

Status: Postponed (maintainer needs more info) » Active

OK I was working on another module and now I'm seeing the errors. It wasn't till I added ANOTHER field to the content type that the errors appeared.

Sylense’s picture

Reverting back to 7.x-1.19 seemed to fix the problem for me thus far. Any idea what's causing the error?

danielb’s picture

New function nodeaccess_nodereference_field_update_instance() saves every field as though it is related to this module, not just reference fields.

danielb’s picture

Status: Active » Fixed

Fixed and new release made. Will do the same for nodeaccess_userreference soon.

johnv’s picture

Status: Fixed » Needs work

This error still occurs after:
- add settings to Nodereference field of content type A, save
- edit/save settings of content type B
Notice: Undefined index: referenced in nodeaccess_nodereference_check_cross_access() (line 606 of nodeaccess_nodereference.module).

After saving and flushing caches, I tried again, no message displayed anymore.

danielb’s picture

Did you run the database update script? That should fix anything that was broken during the time the code was wrong.

danielb’s picture

I notice you posted another issue which had a similar, but actually different error.

johnv’s picture

@#12, the module was installed fresh. the page update.php returns 'No pending updates.'
@#13, Indeed I was doubting to create 1 or 2 messages.

danielb’s picture

Status: Needs work » Closed (fixed)

OK we'll deal with it in the other issue.

carl.ben’s picture

I'm still getting this in 7.21 (first time using NRNA, so update.php isn't a factor). Is the error fixed in dev?

If not, does the patch in http://drupal.org/node/1619636 cover it? The exact error is not mentioned there, but the patch looks like it may address this. Happy to help testing in that issue, but it also looks like a new patch is in the works. Please keep us posted so we can help out.

johnv’s picture

Issue 1619636 covers this message, too. It is the first of the 4 messages.