Commit 6d959ebe authored by Steven Wittens's avatar Steven Wittens

Fixed bug: the first node's id is not calculated correctly

parent 873ee86a
......@@ -149,6 +149,7 @@ function node_save($node, $filter) {
$node->created = time();
$node->changed = time();
$node->nid = db_result(db_query("SELECT MAX(nid) + 1 FROM node"));
$node->nid = empty($node->nid) ? 1 : $node->nid;
// Prepare the query:
foreach ($node as $key => $value) {
......
......@@ -149,6 +149,7 @@ function node_save($node, $filter) {
$node->created = time();
$node->changed = time();
$node->nid = db_result(db_query("SELECT MAX(nid) + 1 FROM node"));
$node->nid = empty($node->nid) ? 1 : $node->nid;
// Prepare the query:
foreach ($node as $key => $value) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment