From 5b2443702c3019dc90d928401f368d3d3fc8dbea Mon Sep 17 00:00:00 2001 From: jschlier <9108576+jschlier@users.noreply.github.com> Date: Fri, 8 Nov 2024 10:45:54 +0100 Subject: [PATCH 1/2] [BUGFIX] Catch empty argument and children in ExplodeListViewHelper --- Classes/ViewHelpers/ExplodeListViewHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/ViewHelpers/ExplodeListViewHelper.php b/Classes/ViewHelpers/ExplodeListViewHelper.php index fa21f51..751d004 100644 --- a/Classes/ViewHelpers/ExplodeListViewHelper.php +++ b/Classes/ViewHelpers/ExplodeListViewHelper.php @@ -62,7 +62,7 @@ public function initializeArguments(): void public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext): array { $splitChar = $arguments['splitChar'] ?? self::DEFAULT_SPLIT_CHAR; - $value = $arguments['value'] ?? $renderChildrenClosure(); + $value = $arguments['value'] ?? $renderChildrenClosure() ?? ''; return explode($splitChar, $value); } } From 51ac9e72843ddb7acd5f00196e46bef8a6616af0 Mon Sep 17 00:00:00 2001 From: jschlier <9108576+jschlier@users.noreply.github.com> Date: Fri, 8 Nov 2024 11:05:05 +0100 Subject: [PATCH 2/2] [TASK] Make sure all possible values are string before passing to explode --- Classes/ViewHelpers/ExplodeListViewHelper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/ViewHelpers/ExplodeListViewHelper.php b/Classes/ViewHelpers/ExplodeListViewHelper.php index 751d004..8ad3a9d 100644 --- a/Classes/ViewHelpers/ExplodeListViewHelper.php +++ b/Classes/ViewHelpers/ExplodeListViewHelper.php @@ -62,7 +62,7 @@ public function initializeArguments(): void public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext): array { $splitChar = $arguments['splitChar'] ?? self::DEFAULT_SPLIT_CHAR; - $value = $arguments['value'] ?? $renderChildrenClosure() ?? ''; - return explode($splitChar, $value); + $value = $arguments['value'] ?? $renderChildrenClosure(); + return explode($splitChar, (string)$value); } }