Index: trunk/core/units/general/helpers/recursive_helper.php =================================================================== diff -u -N -r5177 -r5178 --- trunk/core/units/general/helpers/recursive_helper.php (.../recursive_helper.php) (revision 5177) +++ trunk/core/units/general/helpers/recursive_helper.php (.../recursive_helper.php) (revision 5178) @@ -17,20 +17,20 @@ $this->DeleteCategory($sub_category_id); } } - else { - // 1. remove category items from this category if it is supplemental (non-primary) category to them - $sql = 'DELETE FROM '.TABLE_PREFIX.'CategoryItems - WHERE ('.$id_field.' = '.$category_id.') AND (PrimaryCat = 0)'; - $this->Conn->Query($sql); - - $temp_handler =& $this->Application->recallObject('c_TempHandler', 'kTempTablesHandler'); - - // 2. delete items this have this category as primary -// $temp_handler->DeleteItems($item_prefix, '', $item_ids); - - // 3. delete this category - $temp_handler->DeleteItems('c', '', Array($category_id)); - } + + // 1. remove category items from this category if it is supplemental (non-primary) category to them + $sql = 'DELETE FROM '.TABLE_PREFIX.'CategoryItems + WHERE ('.$id_field.' = '.$category_id.') AND (PrimaryCat = 0)'; + $this->Conn->Query($sql); + + $temp_handler =& $this->Application->recallObject('c_TempHandler', 'kTempTablesHandler'); + + // 2. delete items this have this category as primary +// $temp_handler->DeleteItems($item_prefix, '', $item_ids); + + // 3. delete this category + $temp_handler->DeleteItems('c', '', Array($category_id)); + } } Index: trunk/kernel/units/general/helpers/recursive_helper.php =================================================================== diff -u -N -r5177 -r5178 --- trunk/kernel/units/general/helpers/recursive_helper.php (.../recursive_helper.php) (revision 5177) +++ trunk/kernel/units/general/helpers/recursive_helper.php (.../recursive_helper.php) (revision 5178) @@ -17,20 +17,20 @@ $this->DeleteCategory($sub_category_id); } } - else { - // 1. remove category items from this category if it is supplemental (non-primary) category to them - $sql = 'DELETE FROM '.TABLE_PREFIX.'CategoryItems - WHERE ('.$id_field.' = '.$category_id.') AND (PrimaryCat = 0)'; - $this->Conn->Query($sql); - - $temp_handler =& $this->Application->recallObject('c_TempHandler', 'kTempTablesHandler'); - - // 2. delete items this have this category as primary -// $temp_handler->DeleteItems($item_prefix, '', $item_ids); - - // 3. delete this category - $temp_handler->DeleteItems('c', '', Array($category_id)); - } + + // 1. remove category items from this category if it is supplemental (non-primary) category to them + $sql = 'DELETE FROM '.TABLE_PREFIX.'CategoryItems + WHERE ('.$id_field.' = '.$category_id.') AND (PrimaryCat = 0)'; + $this->Conn->Query($sql); + + $temp_handler =& $this->Application->recallObject('c_TempHandler', 'kTempTablesHandler'); + + // 2. delete items this have this category as primary +// $temp_handler->DeleteItems($item_prefix, '', $item_ids); + + // 3. delete this category + $temp_handler->DeleteItems('c', '', Array($category_id)); + } } Index: trunk/kernel/units/general/my_application.php =================================================================== diff -u -N -r4758 -r5178 --- trunk/kernel/units/general/my_application.php (.../my_application.php) (revision 4758) +++ trunk/kernel/units/general/my_application.php (.../my_application.php) (revision 5178) @@ -31,6 +31,7 @@ $this->registerClass('kModulesHelper', MODULES_PATH.'/kernel/units/general/helpers/modules.php', 'ModulesHelper'); $this->registerClass('kModRewriteHelper', MODULES_PATH.'/kernel/units/general/helpers/mod_rewrite_helper.php', 'ModRewriteHelper'); + $this->registerClass('kRecursiveHelper', MODULES_PATH.'/kernel/units/general/helpers/recursive_helper.php', 'RecursiveHelper'); } function getUserGroups($user_id)