I have the following enabled:
User Reference (under CCK)
Node Access User Reference (under Other)

When I enable the "Node Access User Reference (under Other)", it throws the following error about 40 times on "my account" page:

warning: Invalid argument supplied for foreach() in /home/webuser/public_html/sites/all/modules/cck/modules/userreference/userreference.module on line 828.

Thanks for any help.

Comments

danielb’s picture

I suspect it is not this module? Do you have content types set up?

webdev2’s picture

These are the modules I have enabled:

Under CCK:
Content
Content Permissions
Number
Options Widgets
Text
User Reference

Under OTHER:
Node Access User Reference

I am using a User Reference field to allow me to select users to share or own the document so that when they log in, they can see only their data. It really doesn't matter for this error but thought I would throw it in.

danielb’s picture

Please disable Node Access User Reference and see if you get the error.

Also I have googled this error, and I notice a few other Drupal sites are constantly getting the same error:
http://www.google.com.au/search?q=userreference.module+on+line+828

But no discussion about it?

webdev2’s picture

I disabled, uninstalled, re-enabled both parts of the module and now it works fine. In facts, that solved the permissions error - it wasn't working as it should have before and now it does. I guess it's kind of like rebooting Window$.

Thanks for the mod - it really solves a unique problem.

danielb’s picture

Status: Active » Fixed

I still don't understand what happened here. If anyone experiences this problem, whether using this module or not, perhaps leave a post here for posterity?

sharlene’s picture

I'm very new to Drupal and received this error also many times when I created authenticated user then went to My Account. I'm using Drupal 6.2 :

warning: Invalid argument supplied for foreach() in /home/sharlasw/public_html/blayney/sites/all/modules/cck/modules/userreference/userreference.module on line 828.

After disabling Node Reference and User Reference in CCK as advised above, the warning no longer appears

Status: Fixed » Closed (fixed)

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