Fix broken demand support for categories

This was broken since changes during update.
This commit is contained in:
Daniel Siepmann 2021-02-24 10:46:53 +01:00
parent cbd59a366d
commit 4e2f191030

View file

@ -135,7 +135,7 @@ class EventRepository extends Repository
$allCategories = GeneralUtility::intExplode(',', $demand->getCategories(), true); $allCategories = GeneralUtility::intExplode(',', $demand->getCategories(), true);
if ($demand->includeSubCategories()) { if ($demand->getIncludeSubCategories()) {
$categoryService = GeneralUtility::makeInstance(CategoryService::class); $categoryService = GeneralUtility::makeInstance(CategoryService::class);
$allCategories = $categoryService->getChildrenCategories($demand->getCategories()); $allCategories = $categoryService->getChildrenCategories($demand->getCategories());
if (!\is_array($allCategories)) { if (!\is_array($allCategories)) {
@ -144,7 +144,7 @@ class EventRepository extends Repository
} }
foreach ($allCategories as $category) { foreach ($allCategories as $category) {
$constraints[] = $query->contains('demand->getCategories()', $category); $constraints[] = $query->contains('categories', $category);
} }
if ($demand->getCategoryCombination() === 'or') { if ($demand->getCategoryCombination() === 'or') {