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
This commit is contained in:
parent
019b0a3a6c
commit
a9e198c8b4
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue