Index: trunk/core/kernel/utility/temp_handler.php =================================================================== diff -u -r4758 -r5174 --- trunk/core/kernel/utility/temp_handler.php (.../temp_handler.php) (revision 4758) +++ trunk/core/kernel/utility/temp_handler.php (.../temp_handler.php) (revision 5174) @@ -454,8 +454,14 @@ if ($master['TableName'] == $this->MasterTable) { $this->RaiseEvent( 'OnBeforeDeleteFromLive', $master['Prefix'], '', $current_ids ); - $query = 'DELETE FROM '.$master['TableName'].' WHERE '.$master['IdField'].' IN ('.join(',', $current_ids).')'; - $this->Conn->Query($query); + // Do not delete live items with 0 id + // otherwise home category permissions got deleted when creating new category + $del_ids = $current_ids; + array_splice($del_ids, array_search(0, $current_ids), 1); + if (count($del_ids) >= 1) { + $query = 'DELETE FROM '.$master['TableName'].' WHERE '.$master['IdField'].' IN ('.join(',', $del_ids).')'; + $this->Conn->Query($query); + } } if ( getArrayValue($master, 'SubTables') ) {