Index: branches/5.0.x/core/install.php =================================================================== diff -u -N -r12808 -r12809 --- branches/5.0.x/core/install.php (.../install.php) (revision 12808) +++ branches/5.0.x/core/install.php (.../install.php) (revision 12809) @@ -1,6 +1,6 @@ toolkit->RunSQL('/core/install/install_data.sql'); // create category using sql, because Application is not available here + $table_name = $this->toolkit->getSystemConfig('Database', 'TablePrefix') . 'IdGenerator'; + $this->Conn->Query('UPDATE ' . $table_name . ' SET lastid = lastid + 1'); + $resource_id = $this->Conn->GetOne('SELECT lastid FROM ' . $table_name); + if ($resource_id === false) { + $this->Conn->Query('INSERT INTO '.$table_name.' (lastid) VALUES (2)'); + $resource_id = 2; + } + $fields_hash = Array ( 'l1_Name' => 'Content', 'Filename' => 'Content', 'AutomaticFilename' => 0, + 'CreatedById' => -1, 'CreatedOn' => time(), 'ResourceId' => $resource_id - 1, 'l1_Description' => 'Content', 'Status' => 4, );