Index: trunk/kernel/include/itemdb.php =================================================================== diff -u -r1072 -r1442 --- trunk/kernel/include/itemdb.php (.../itemdb.php) (revision 1072) +++ trunk/kernel/include/itemdb.php (.../itemdb.php) (revision 1442) @@ -418,35 +418,35 @@ function Create() { - global $Errors, $objSession; - - if($this->debuglevel) echo "Creating Item: ".get_class($this)."
"; - if($this->NoResourceId!=1 && (int)$this->Get("ResourceId")==0) - { - $this->Set("ResourceId", GetNextResourceId()); - } - $sql = $this->CreateSql(); - - if($this->debuglevel>0) - echo $sql."
\n"; + global $Errors, $objSession; - if ($this->adodbConnection->Execute($sql) === false) - { - $Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"Create"); - return false; - } + if($this->debuglevel) echo "Creating Item: ".get_class($this)."
"; + if($this->NoResourceId!=1 && (int)$this->Get("ResourceId")==0) + { + $this->Set("ResourceId", GetNextResourceId()); + } + $sql = $this->CreateSql(); - $this->SetUniqueId($this->adodbConnection->Insert_ID()); - - if ($objSession->GetVariable("HasChanges") == 2) { - $objSession->SetVariable("HasChanges", 1); - } - - /*if ($this->adodbConnection->Affected_Rows() > 0) { - $objSession->SetVariable("HasChanges", 1); - } */ - - return true; + if($this->debuglevel>0) + echo $sql."
\n"; + + if ($this->adodbConnection->Execute($sql) === false) + { + $Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"Create"); + return false; + } + + $this->SetUniqueId($this->adodbConnection->Insert_ID()); + + if ($objSession->GetVariable("HasChanges") == 2) { + $objSession->SetVariable("HasChanges", 1); + } + + /*if ($this->adodbConnection->Affected_Rows() > 0) { + $objSession->SetVariable("HasChanges", 1); + } */ + + return true; } function Increment($field, $calculate_hot = false)