Index: branches/5.1.x/core/kernel/db/dbitem.php =================================================================== diff -u -N -r13900 -r13952 --- branches/5.1.x/core/kernel/db/dbitem.php (.../dbitem.php) (revision 13900) +++ branches/5.1.x/core/kernel/db/dbitem.php (.../dbitem.php) (revision 13952) @@ -1,6 +1,6 @@ IDField) && ($field_value == 0)) { + if (($field_name == $this->IDField) && ($field_value == 0) && !is_int($force_id)) { // don't skip IDField in INSERT statement, just use DEFAULT keyword as it's value $values_sql .= 'DEFAULT'; } @@ -968,7 +968,7 @@ $this->Application->resetCounters($this->TableName); } - if ($this->IsTempTable() && ($this->Application->GetTopmostPrefix($this->Prefix) != $this->Prefix)) { + if ($this->IsTempTable() && ($this->Application->GetTopmostPrefix($this->Prefix) != $this->Prefix) && !is_int($force_id)) { // temp table + subitem = set negative id $this->setTempID(); }