Browse Source

Add cache tag for current user (Islandora#2272)

pull/997/head
Ant Brown 1 year ago
parent
commit
bd377ee7d4
  1. 3
      src/IslandoraUtils.php

3
src/IslandoraUtils.php

@ -4,6 +4,7 @@ namespace Drupal\islandora;
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;
@ -306,7 +307,7 @@ class IslandoraUtils {
$cid,
$term,
CacheBackendInterface::CACHE_PERMANENT,
$term->getCacheTags()
Cache::mergeTags(array_merge($term->getCacheTags(), ['user:' . $this->currentUser->id()]))
);
return $term;

Loading…
Cancel
Save