If an invalid user tries to login, a bunch of warnings are spewed out at the top of the page html, moving the entire page down, and displaying the errors below:

(A note about line numbers listed below: I've installed the "permissions for edit node permissions" patch)

warning: array_keys(): The first argument should be an array in /home/drupal/modules/node_privacy_byrole.module on line 143.

warning: Invalid argument supplied for foreach() in /home/drupal/modules/node.module on line 1675.

warning: array_keys(): The first argument should be an array in /home/rioterrace/domains/rioterracehoa.org/public_html/test/modules/node_privacy_byrole.module on line 143.

warning: Invalid argument supplied for foreach() in /home/drupal/modules/node.module on line 1675.

warning: array_keys(): The first argument should be an array in /home/drupal/modules/node_privacy_byrole.module on line 143.

warning: Invalid argument supplied for foreach() in /home/drupal/modules/node.module on line 1675.

CommentFileSizeAuthor
#3 node_privacy_byrole_role_2.patch864 bytesJhef.Vicedo
error.png36.47 KBstelman

Comments

stelman’s picture

btw: I edited the paths in the error statements I listed for the sake of brevity, and messed one up, so that's why they don't all match.

A screenshot is attached to the original post.

ankur’s picture

I wasn't able to reproduce the error. This is likely an issue with the patch that you tried. As far as the 'edit permissions' permission goes, this may be integrated as a something you can configure in a node's workflow in the future, but not at this time.

-Ankur

Jhef.Vicedo’s picture

Assigned: Unassigned » Jhef.Vicedo
StatusFileSize
new864 bytes

$user->roles property for invalid users are empty that's why there is an error in array_keys() 'argument type' and in foreach(). this patch fix this.

gmills@gregmills.com’s picture

I'm getting the same error. How do I apply the patch?

ankur’s picture

Refreshing this thread so that it floats to the top. Patch will be examined for 4.5 -> 4.6 port.

-Ankur

keschrich’s picture

I am having the same problem, although I do not use node_privacy_byrole, rather I've been using nodeperm_role.module.

warning: array_keys(): The first argument should be an array in /home/troop428/public_html/drupal-cvs/modules/nodeperm_role/nodeperm_role.module on line 31.

warning: Invalid argument supplied for foreach() in /home/troop428/public_html/drupal-cvs/modules/node.module on line 1961.

warning: array_keys(): The first argument should be an array in /home/troop428/public_html/drupal-cvs/modules/nodeperm_role/nodeperm_role.module on line 31.

warning: Invalid argument supplied for foreach() in /home/troop428/public_html/drupal-cvs/modules/node.module on line 1915.

Bottom four lines are repeated about a dozen or so times.

ankur’s picture

Anonymous’s picture

Anonymous’s picture