From 76a142bcf1836f681fa155fc5635bc60f728c06e Mon Sep 17 00:00:00 2001
From: Philipp Halle
Date: Wed, 8 Nov 2023 16:02:59 +0100
Subject: [PATCH] [BUGFIX] Fix array access on object
---
Classes/ViewHelpers/Form/FilterViewHelper.php | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/Classes/ViewHelpers/Form/FilterViewHelper.php b/Classes/ViewHelpers/Form/FilterViewHelper.php
index ff8b728..eb8ad94 100644
--- a/Classes/ViewHelpers/Form/FilterViewHelper.php
+++ b/Classes/ViewHelpers/Form/FilterViewHelper.php
@@ -48,10 +48,10 @@ public function render()
$selectedCategories = $filter->getFilterCategories();
if ($this->arguments['options'] instanceof \Traversable) {
- /** @var AcademicCategory[] $categoriesOption */
- $categoriesOption = $this->arguments['options'];
+ /** @var AcademicCategory[] $categoryOptions */
+ $categoryOptions = $this->arguments['options'];
- foreach ($categoriesOption as $category) {
+ foreach ($categoryOptions as $category) {
$value = $category->getUid();
$label = $category->getTitle();
@@ -69,9 +69,10 @@ public function render()
$options .= $option . LF;
}
- if (count($categoriesOption) > 0) {
+ if (count($categoryOptions) > 0) {
+ $categoryOptions->rewind();
$prepend .= '' . LF;
}
}