Index: branches/5.1.x/core/kernel/db/cat_dbitem.php =================================================================== diff -u -N -r14394 -r14439 --- branches/5.1.x/core/kernel/db/cat_dbitem.php (.../cat_dbitem.php) (revision 14394) +++ branches/5.1.x/core/kernel/db/cat_dbitem.php (.../cat_dbitem.php) (revision 14439) @@ -1,6 +1,6 @@ GetDBField('CategoryId') > 0 ? $this->GetDBField('CategoryId') : $this->Application->GetVar('m_cat_id'); - $this->assignToCategory($primary_category, true); - $this->SetDBField('CategoryId', $primary_category); // set primary category in item object + if ( $this->GetDBField('CategoryId') <= 0 ) { + // set primary category in item object + $this->SetDBField('CategoryId', $this->Application->GetVar('m_cat_id')); + } + + $this->assignToCategory($this->GetDBField('CategoryId'), true); } function Update($id=null, $system_update=false) @@ -125,7 +128,6 @@ return $table; } - function checkFilename() { if( !$this->GetDBField('AutomaticFilename') )