Index: branches/unlabeled/unlabeled-1.32.2/kernel/units/general/cat_dbitem.php =================================================================== diff -u -r5635 -r5820 --- branches/unlabeled/unlabeled-1.32.2/kernel/units/general/cat_dbitem.php (.../cat_dbitem.php) (revision 5635) +++ branches/unlabeled/unlabeled-1.32.2/kernel/units/general/cat_dbitem.php (.../cat_dbitem.php) (revision 5820) @@ -70,7 +70,8 @@ if ($ret) { $table = $this->Application->IsTempTable($this->TableName) ? $this->Application->GetTempName(TABLE_PREFIX.'CategoryItems') : TABLE_PREFIX.'CategoryItems'; - $this->Conn->Query('UPDATE '.$table.' SET Filename = '.$this->Conn->qstr($this->GetDBField('Filename')).' WHERE ItemResourceId = '.$this->GetDBField('ResourceId')); + $filename = $this->useFilenames ? $this->GetDBField('Filename') : ''; + $this->Conn->Query('UPDATE '.$table.' SET Filename = '.$this->Conn->qstr($filename).' WHERE ItemResourceId = '.$this->GetDBField('ResourceId')); } unset($this->VirtualFields['ResourceId']); @@ -310,7 +311,8 @@ } else { $sql = 'INSERT INTO '.$table.' (CategoryId,ItemResourceId,PrimaryCat,ItemPrefix,Filename) VALUES (%s,%s,%s,%s,%s)'; - $this->Conn->Query( sprintf($sql, $category_id, $this->GetDBField('ResourceId'), $is_primary ? 1 : 0, $this->Conn->qstr($this->Prefix), $this->Conn->qstr($this->GetDBField('Filename'))) ); + $filename = $this->useFilenames ? $this->GetDBField('Filename') : ''; // because some prefixes does not use filenames + $this->Conn->Query( sprintf($sql, $category_id, $this->GetDBField('ResourceId'), $is_primary ? 1 : 0, $this->Conn->qstr($this->Prefix), $this->Conn->qstr($filename)) ); } // to ensure filename update after adding to another category // this is critical since there may be an item with same filename in newly added category!