From a9e198c8b4e4eaee2438cd89d2e3d6e3e6e93bd5 Mon Sep 17 00:00:00 2001 From: SeriousKen Date: Mon, 20 May 2019 06:32:29 +0100 Subject: [PATCH] Add check to make sure event result is an array in Form widget (#4331) Wildcard listeners will add null responses to the event result array and causes an error when they are merged into the result. This PR adds a check to see if each event result is an array before adding it to the result array. Credit to @SeriousKen. Fixes https://github.com/OFFLINE-GmbH/oc-clockwork-plugin/issues/1 --- modules/backend/widgets/Form.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/backend/widgets/Form.php b/modules/backend/widgets/Form.php index c7e702a99..741fc7d46 100644 --- a/modules/backend/widgets/Form.php +++ b/modules/backend/widgets/Form.php @@ -449,6 +449,10 @@ class Form extends WidgetBase $eventResults = $this->fireSystemEvent('backend.form.refresh', [$result], false); foreach ($eventResults as $eventResult) { + if (!is_array($eventResult)) { + continue; + } + $result = $eventResult + $result; }