forked from extern/egroupware
if not category specified to invalidate_cache() call init_cache(), to fix problem of categories deleted via context menu are not deleted from list (only in next, but not in current refresh)
This commit is contained in:
parent
59f7a93cbb
commit
96796f5edb
@ -550,6 +550,7 @@ class categories
|
||||
*/
|
||||
function delete($cat_id, $drop_subs = False, $modify_subs = False)
|
||||
{
|
||||
//error_log(__METHOD__."(".array2string($cat_id).', drop_subs='.array2string($drop_subs).', modify_subs='.array2string($modify_subs).') '.function_backtrace());
|
||||
if ($modify_subs)
|
||||
{
|
||||
$new_parent = $this->id2name($cat_id,'parent');
|
||||
@ -966,6 +967,8 @@ class categories
|
||||
*/
|
||||
public static function invalidate_cache($cat=null)
|
||||
{
|
||||
//error_log(__METHOD__."(".array2string($cat).') '.function_backtrace());
|
||||
|
||||
// allways invalidate instance-global cache, as updating our own cache is not perfect and does not help other sessions
|
||||
egw_cache::unsetInstance(self::CACHE_APP, self::CACHE_NAME);
|
||||
|
||||
@ -984,6 +987,10 @@ class categories
|
||||
self::$cache[$cat['id']] = $cat;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
self::init_cache();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user