in head and latest 6.x:

/**
 * Store permission settings for workflow states.
 */
function workflow_access_form_submit($form, $form_state) {
  foreach ($form_state['values']['workflow_access'] as $sid => $access) {
    // Ignore irrelevant keys.
    if (!is_numeric($sid)) {
      continue; 
    }

    $grants = array();
    db_query("DELETE FROM {workflow_access} WHERE sid = %d", $sid);
    foreach ($access['view'] as $rid => $checked) {
      $grants[] = array(
        'realm'        => ($rid == -1) ? 'workflow_access_owner' : 'workflow_access',
        'gid'          => ($rid == -1) ? $node->uid : $rid,
        'grant_view'   => (bool)$checked,
        'grant_update' => (bool)$access['update'][$rid],
        'grant_delete' => (bool)$access['delete'][$rid],
      );

this was copied over from workflow_access_node_access_records$node) where $node exists; but it doesn't in form_submit hook; so not possible to get $node->uid

code can't work as there is no $node obj at this point

Comments

liquidcms’s picture

Title: workflow_perms for node author can't possibly work » workflow_perms for node author uses non-existent $node obj
Priority: Critical » Normal

changed title cuz it does work. it just isnt coded correctly

fgm’s picture

Still there in current version after 18 months. This looks like it should build possibly incorrect rules for the first node, since it uses NULL for the node UID.

Bastlynn’s picture

Status: Active » Closed (fixed)

This was fixed with 7 and will be applied to 6. Thanks!