Automatically update the sidebar trees for all users if the trees are changed somehow.

This commit is contained in:
Jan Böhmer 2022-09-25 02:08:54 +02:00
parent 2bd41eee60
commit 4c25e85a48
5 changed files with 73 additions and 0 deletions

View file

@ -75,6 +75,11 @@ class TreeCacheInvalidationListener
if ($element instanceof AbstractStructuralDBElement || $element instanceof LabelProfile) {
$secure_class_name = str_replace('\\', '_', get_class($element));
$this->cache->invalidateTags([$secure_class_name]);
//Trigger a sidebar reload for all users (see SidebarTreeUpdater service)
if(!$element instanceof LabelProfile) {
$this->cache->invalidateTags(['sidebar_tree_update']);
}
}
//If a user change, then invalidate all cached trees for him