mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 23:13:15 +00:00
fix DB collection cache (#4130)
This commit is contained in:
@@ -74,4 +74,10 @@ class ArrayCacheCollectionRepository implements CollectionRepository
|
||||
unset($this->collectionCache[$collection->getCollectionId()]);
|
||||
}
|
||||
}
|
||||
|
||||
public function clearCache()
|
||||
{
|
||||
$this->collectionCache = null;
|
||||
$this->collectionRepository->clearCache();
|
||||
}
|
||||
}
|
||||
|
@@ -91,15 +91,18 @@ final class CachedCollectionRepository implements CollectionRepository
|
||||
{
|
||||
$this->repository->save($collection);
|
||||
|
||||
$cacheKey = $this->getCacheKey();
|
||||
|
||||
$this->cache->delete($cacheKey);
|
||||
$this->clearCache();
|
||||
}
|
||||
|
||||
public function delete(Collection $collection)
|
||||
{
|
||||
$this->repository->delete($collection);
|
||||
|
||||
$this->clearCache();
|
||||
}
|
||||
|
||||
public function clearCache()
|
||||
{
|
||||
$cacheKey = $this->getCacheKey();
|
||||
|
||||
$this->cache->delete($cacheKey);
|
||||
|
@@ -597,6 +597,9 @@ class collection implements ThumbnailedElement, cache_cacheableInterface
|
||||
$this->getReferenceRepository()->save($this->reference);
|
||||
$this->collectionRepositoryRegistry->purgeRegistry();
|
||||
|
||||
// clear cached collection
|
||||
$this->getCollectionRepository()->clearCache();
|
||||
|
||||
// clear the trivial cache of databox->get_collections()
|
||||
$this->get_databox()->clearCache(databox::CACHE_COLLECTIONS);
|
||||
|
||||
@@ -617,6 +620,9 @@ class collection implements ThumbnailedElement, cache_cacheableInterface
|
||||
$this->getReferenceRepository()->save($this->reference);
|
||||
$this->collectionRepositoryRegistry->purgeRegistry();
|
||||
|
||||
// clear cached collection
|
||||
$this->getCollectionRepository()->clearCache();
|
||||
|
||||
// clear the trivial cache of databox->get_collections()
|
||||
$this->get_databox()->clearCache(databox::CACHE_COLLECTIONS);
|
||||
|
||||
|
@@ -198,7 +198,7 @@
|
||||
<li>
|
||||
<form class='form-inline' method="post" action="{{ path('admin_collection_enable', {'bas_id': baseId}) }}">
|
||||
{{ baseId|bas_labels(app) }}
|
||||
<a href="#" class="btn btn-mini reload submiter">{{ "Activer" | trans }}></a>
|
||||
<a href="#" class="btn btn-mini reload submiter">{{ "Activer" | trans }}</a>
|
||||
</form>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
Reference in New Issue
Block a user