Index: trunk/globals.php =================================================================== diff -u -r1055 -r1248 --- trunk/globals.php (.../globals.php) (revision 1055) +++ trunk/globals.php (.../globals.php) (revision 1248) @@ -972,12 +972,18 @@ $sql = 'SELECT ItemType FROM '.$objItemTypes->SourceTable.' WHERE ItemName=\''.$item_type.'\''; $item_type=$db->GetOne($sql); } + $objCountCache->EraseGlobalTypeCache($item_type); if($item_type) { if(is_array($CategoriesIds)) { $CategoriesIds=implode(',',$CategoriesIds); } + if (!$CategoriesIds) + { + + } + if(!is_array($ListType)) $ListType=Array($ListType=>'opa'); $sql = 'SELECT ParentPath FROM '.GetTablePrefix().'Category WHERE CategoryId IN ('.$CategoriesIds.')'; Index: trunk/kernel/include/cachecount.php =================================================================== diff -u -r748 -r1248 --- trunk/kernel/include/cachecount.php (.../cachecount.php) (revision 748) +++ trunk/kernel/include/cachecount.php (.../cachecount.php) (revision 1248) @@ -202,6 +202,20 @@ $c->Delete(); } } + + function EraseGlobalTypeCache($ItemType) + { + global $objItemTypes; + + $db = &GetADODBConnection(); + if( !is_numeric($ItemType) ) + { + $sql = 'SELECT ItemType FROM '.$objItemTypes->SourceTable.' WHERE ItemName=\''.$ItemType.'\''; + $ItemType=$db->GetOne($sql); + } + $sql='DELETE FROM '.$this->SourceTable.' WHERE ItemType='.$ItemType.' AND ListType=0'; + $rs = $db->Execute($sql); + } function IncrementParentValues($ValueName,$CatList,$IncVal=1) {