diff --git a/components/ILIAS/News/src/Domain/NewsCollectionService.php b/components/ILIAS/News/src/Domain/NewsCollectionService.php index 4e162162a5b0..198e8fde42ed 100644 --- a/components/ILIAS/News/src/Domain/NewsCollectionService.php +++ b/components/ILIAS/News/src/Domain/NewsCollectionService.php @@ -93,7 +93,7 @@ public function getNewsForContext( public function invalidateCache(int $user_id): void { - $this->cache->invalidateNewsForUser($user_id, new NewsCriteria()); + $this->cache->invalidateNewsForUser($user_id); } /** diff --git a/components/ILIAS/News/src/Persistence/NewsCache.php b/components/ILIAS/News/src/Persistence/NewsCache.php index 57c6ebcae32f..44667ea4385b 100644 --- a/components/ILIAS/News/src/Persistence/NewsCache.php +++ b/components/ILIAS/News/src/Persistence/NewsCache.php @@ -193,13 +193,14 @@ public function storeNewsForUser(int $user_id, NewsCriteria $criteria, NewsColle $this->il_cache->storeEntry( $this->generateL3Key($user_id, $criteria), - serialize($news->getUserReadStatus($user_id)) + serialize($news->getUserReadStatus($user_id)), + $user_id ); } - public function invalidateNewsForUser(int $user_id, NewsCriteria $criteria): void + public function invalidateNewsForUser(int $user_id): void { - $this->il_cache->deleteEntry($this->generateL3Key($user_id, $criteria)); + $this->il_cache->deleteByAdditionalKeys($user_id); } protected function generateL3Key(int $user_id, NewsCriteria $criteria): string