Skip to content

Commit 8738fd1

Browse files
authored
INT-238: Fix category page with disabled HTTP cache
Fix category page with disabled HTTP cache
1 parent e565947 commit 8738fd1

2 files changed

Lines changed: 0 additions & 8 deletions

File tree

src/Resources/config/services.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@
113113
</service>
114114

115115
<service id="Omikron\FactFinder\Shopware6\Subscriber\CategoryPageResponseSubscriber">
116-
<argument>%shopware.http.cache.enabled%</argument>
117116
<argument type="service" id="category.repository" />
118117
</service>
119118

src/Subscriber/CategoryPageResponseSubscriber.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
*/
2727
class CategoryPageResponseSubscriber implements EventSubscriberInterface
2828
{
29-
private bool $httpCacheEnabled;
3029
private EntityRepository $categoryRepository;
3130
private Communication $config;
3231
private SearchAdapter $searchAdapter;
@@ -35,15 +34,13 @@ class CategoryPageResponseSubscriber implements EventSubscriberInterface
3534
private EventDispatcherInterface $eventDispatcher;
3635

3736
public function __construct(
38-
bool $httpCacheEnabled,
3937
EntityRepository $categoryRepository,
4038
Communication $config,
4139
SearchAdapter $searchAdapter,
4240
Engine $handlebars,
4341
CategoryPath $categoryPath,
4442
EventDispatcherInterface $eventDispatcher,
4543
) {
46-
$this->httpCacheEnabled = $httpCacheEnabled;
4744
$this->categoryRepository = $categoryRepository;
4845
$this->config = $config;
4946
$this->searchAdapter = $searchAdapter;
@@ -125,10 +122,6 @@ private function getCategoryPath(Request $request): string
125122
return '';
126123
}
127124

128-
if ($this->httpCacheEnabled === false) {
129-
return $request->attributes->get('categoryPath', '');
130-
}
131-
132125
$criteria = new Criteria();
133126
$criteria->addFilter(new EqualsFilter('id', $categoryId));
134127
$category = $this->categoryRepository->search($criteria, Context::createDefaultContext())->first();

0 commit comments

Comments
 (0)