Index: node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node.module,v retrieving revision 1.527 diff -u -p -r1.527 node.module --- node.module 2 Sep 2005 02:11:41 -0000 1.527 +++ node.module 7 Sep 2005 19:35:03 -0000 @@ -438,11 +438,11 @@ function node_save(&$node) { } // Split off revisions data to another structure - $revisions_table_values = array('nid' => $node->nid, 'vid' => $node->vid, + $revisions_table_values = array('nid' => $node->nid, 'vid' => $node->vid, 'type' => $node->type, 'title' => $node->title, 'body' => $node->body, 'teaser' => $node->teaser, 'log' => $node->log, 'timestamp' => $node->changed, 'uid' => $user->uid, 'format' => $node->format); - $revisions_table_types = array('nid' => '%d', 'vid' => '%d', + $revisions_table_types = array('nid' => '%d', 'vid' => '%d', 'type' => "'%s'", 'title' => "'%s'", 'body' => "'%s'", 'teaser' => "'%s'", 'log' => "'%s'", 'timestamp' => '%d', 'uid' => '%d', 'format' => '%d'); @@ -1665,8 +1665,8 @@ function node_page_default() { * Menu callback; dispatches control to the appropriate operation handler. */ function node_page() { - $op = $_POST['op'] ? $_POST['op'] : arg(1); - $edit = $_POST['edit']; + $op = isset($_POST['op']) ? $_POST['op'] : arg(1); + $edit = isset($_POST['edit']) ? $_POST['edit'] : NULL ; if (is_numeric($op)) { $op = (arg(2) && !is_numeric(arg(2))) ? arg(2) : 'view'; @@ -2015,8 +2015,14 @@ function node_access_view_all_nodes() { } } $sql .= implode(',', $grants) .') AND grant_view = 1'; - $result = db_query($sql, $node->nid); - $access = db_result($result); + + if (isset($node->nid)) { + $result = db_query($sql, $node->nid); + $access = db_result($result); + } + else { + $access = NULL; + } } return $access;