+ if ($duplicates_found || $has_page) // other category has same filename as ours OR we have filename, that ends with _number
{
- $append = $found_item_id ? 'a' : '';
+ $append = $duplicates_found ? 'a' : '';
if($has_page)
{
$filename = $rets[1].'_'.$rets[2];
$append = $rets[3] ? $rets[3] : 'a';
}
// check live & temp table
$sql_temp = 'SELECT '.$this->IDField.' FROM '.$this->TableName.' WHERE (Filename = %s) AND ('.$this->IDField.' != '.$this->GetID().')';
$sql_live = 'SELECT '.$this->IDField.' FROM '.kTempTablesHandler::GetLiveName($this->TableName).' WHERE (Filename = %s) AND ('.$this->IDField.' != '.$this->GetID().')';
while ( $this->Conn->GetOne( sprintf($sql_temp, $this->Conn->qstr($filename.$append)) ) > 0 ||
+ if ($duplicates_found || $has_page) // other category has same filename as ours OR we have filename, that ends with _number
{
- $append = $found_item_id ? 'a' : '';
+ $append = $duplicates_found ? 'a' : '';
if($has_page)
{
$filename = $rets[1].'_'.$rets[2];
$append = $rets[3] ? $rets[3] : 'a';
}
// check live & temp table
$sql_temp = 'SELECT '.$this->IDField.' FROM '.$this->TableName.' WHERE (Filename = %s) AND ('.$this->IDField.' != '.$this->GetID().')';
$sql_live = 'SELECT '.$this->IDField.' FROM '.kTempTablesHandler::GetLiveName($this->TableName).' WHERE (Filename = %s) AND ('.$this->IDField.' != '.$this->GetID().')';
while ( $this->Conn->GetOne( sprintf($sql_temp, $this->Conn->qstr($filename.$append)) ) > 0 ||