Browse Source

Only cache terms that exist (Islandora#2272)

pull/997/head
Ant Brown 9 months ago
parent
commit
14a6715696
  1. 3
      src/IslandoraUtils.php

3
src/IslandoraUtils.php

@ -301,14 +301,13 @@ class IslandoraUtils {
if (!empty($results)) {
$term = $this->entityTypeManager->getStorage('taxonomy_term')
->load(reset($results));
}
$this->cache->set(
$cid,
$term,
CacheBackendInterface::CACHE_PERMANENT,
Cache::mergeTags(array_merge($term->getCacheTags(), ['user:' . $this->currentUser->id()]))
);
}
return $term;
}

Loading…
Cancel
Save