mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-06 00:14:36 +02:00
Automatically update the sidebar trees for all users if the trees are changed somehow.
This commit is contained in:
parent
2bd41eee60
commit
4c25e85a48
5 changed files with 73 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue