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.

CommentFileSizeAuthor
#1 simple_access_203176.patch.txt1.11 KBdww

Comments

dww’s picture

Assigned: Unassigned » dww
Status: Active » Needs review
StatusFileSize
new1.11 KB
gordon’s picture

Status: Needs review » Fixed

Thanks fix in dev

dww’s picture

Version: 5.x-1.0 » 5.x-1.x-dev
Status: Fixed » Patch (to be ported)

Only committed to HEAD, please commit to DRUPAL-5, too. Thanks. ;)

gordon’s picture

Status: Patch (to be ported) » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

whoops, fixing pasted code

  • Commit 7bc288f on 5.x-2.x, 6.x-2.x, master, 8.x-3.x by gordon:
    * #203176 - Fix issue when there is no access types set.