Tags: Fix clearing internal cache after removing a tag

This commit is contained in:
Aleksander Machniak 2019-09-29 09:18:55 +00:00
parent 832a16ddf3
commit f08efd9170
2 changed files with 5 additions and 1 deletions

View file

@ -236,7 +236,7 @@ class kolab_storage_config
// on success, update cached tags list
if ($status && is_array($this->tags)) {
foreach ($this->tags as $idx => $tag) {
if ($tag['uid'] == $uid) {
if ($tag['uid'] == $object['uid']) {
unset($this->tags[$idx]);
break;
}

View file

@ -230,5 +230,9 @@ class kolab_storage_config_test extends PHPUnit_Framework_TestCase
// get tags again, make sure it contains the new tag
$tags = $config->get_tags();
$this->assertCount(4, $tags);
foreach ($tags as $_tag) {
$this->assertTrue($_tag['uid'] != $tag['uid']);
}
}
}