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 Jul 30, 2024
1 parent b3cced0 commit 579e056
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 @@ -316,7 +317,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 579e056

Please sign in to comment.