Skip to content

Commit

Permalink
[BUGFIX] Fix array access on object
Browse files Browse the repository at this point in the history
  • Loading branch information
dot3media committed Nov 8, 2023
1 parent 269b285 commit 76a142b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Classes/ViewHelpers/Form/FilterViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -69,9 +69,10 @@ public function render()
$options .= $option . LF;
}

if (count($categoriesOption) > 0) {
if (count($categoryOptions) > 0) {
$categoryOptions->rewind();
$prepend .= '<option value="0">';
$prepend .= LocalizationUtility::translate('sys_category.type.' . $categoriesOption[0]->getType()->__toString(), 'academic_projects');
$prepend .= LocalizationUtility::translate('sys_category.type.' . $categoryOptions->current()->getType()->__toString(), 'academic_projects');
$prepend .= '</option>' . LF;
}
}
Expand Down

0 comments on commit 76a142b

Please sign in to comment.