Skip to content

Commit

Permalink
Add cache tag for current user (Islandora#2272)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ant Brown committed Dec 3, 2023
1 parent ef0ee76 commit 5dfc8dc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/IslandoraUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Drupal\context\ContextManager;
use Drupal\Component\Utility\Html;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Entity\EntityFieldManagerInterface;
Expand Down Expand Up @@ -306,7 +307,7 @@ public function getTermForUri($uri) {
$cid,
$term,
CacheBackendInterface::CACHE_PERMANENT,
$term->getCacheTags()
Cache::mergeTags(array_merge($term->getCacheTags(), ['user:' . $this->currentUser->id()]))
);

return $term;
Expand Down

0 comments on commit 5dfc8dc

Please sign in to comment.