I just tried installing simple_access on a test site. Before creating any simple_access groups, I tried to create a new node as UID 1, and hit this:
warning: Invalid argument supplied for foreach() in /.../modules/simple_access/simple_access.module on line 135
Which corresponds with the following:
function simple_access_nodeapi(&$node, $op) {
...
case 'update':
case 'insert':
db_query('DELETE FROM {simple_access_node} WHERE nid = %d', $node->nid);
foreach ($node->simple_access as $gid => $access) { // <==== Here's line 135
db_query("INSERT INTO {simple_access_node} (`nid`, `gid`, `view`, `update`, `delete`) VALUES (%d, %d, %d, %d, %d)", $node->nid, $gid, $access['view'], $access['update'], $access['delete']);
}
break;
Seems like we just assume $node->simple_access must exist, when it's entirely possible it's not defined at all.
Comments
Comment #1
dwwComment #2
gordon commentedThanks fix in dev
Comment #3
dwwOnly committed to HEAD, please commit to DRUPAL-5, too. Thanks. ;)
Comment #4
gordon commentedComment #5
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #5.0
(not verified) commentedwhoops, fixing pasted code