Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion library/alnv/CatalogView.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace CatalogManager;

use Contao\System;


class CatalogView extends CatalogController
{
Expand Down Expand Up @@ -769,6 +771,17 @@ public function getCatalogView($arrQuery)
$arrCatalogs[] = $arrCatalog;
}

if (System::getContainer()->has('fos_http_cache.http.symfony_response_tagger')) {
$responseTagger = System::getContainer()->get('fos_http_cache.http.symfony_response_tagger');
$tag = 'contao.db.'.$this->catalogTablename;

if ('view' === $this->strMode) {
$responseTagger->addTags([$tag]);
} elseif ('master' === $this->strMode) {
$responseTagger->addTags(array_map(static function ($record) use ($tag) { return $tag.'.'.$record['id']; }, $arrCatalogs));
}
}

if ($intPerPage > 0 && $this->catalogAddPagination && $this->strMode == 'view') {

$this->objMainTemplate->pagination = $this->TemplateHelper->addPagination($intTotal, $intPerPage, $strPageID, ($this->arrViewPage['id'] ?? ''));
Expand Down Expand Up @@ -1605,4 +1618,4 @@ public function getCatalogFields()

return $this->arrCatalogFields;
}
}
}