Skip to content

Commit 5dfc8dc

Browse files
author
Ant Brown
committed
Add cache tag for current user (Islandora#2272)
1 parent ef0ee76 commit 5dfc8dc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/IslandoraUtils.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Drupal\context\ContextManager;
66
use Drupal\Component\Utility\Html;
7+
use Drupal\Core\Cache\Cache;
78
use Drupal\Core\Cache\CacheBackendInterface;
89
use Drupal\Core\Entity\ContentEntityInterface;
910
use Drupal\Core\Entity\EntityFieldManagerInterface;
@@ -306,7 +307,7 @@ public function getTermForUri($uri) {
306307
$cid,
307308
$term,
308309
CacheBackendInterface::CACHE_PERMANENT,
309-
$term->getCacheTags()
310+
Cache::mergeTags(array_merge($term->getCacheTags(), ['user:' . $this->currentUser->id()]))
310311
);
311312

312313
return $term;

0 commit comments

Comments
 (0)