Skip to content

Commit

Permalink
Fix Dprecated Warning in PHP8.1
Browse files Browse the repository at this point in the history
Deprecated: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated in redaxo/src/addons/mform/lib/MForm/Parser/MFormParser.php on line 411
  • Loading branch information
marcohanke authored Apr 19, 2023
1 parent 6641b41 commit 8e10958
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/MForm/Parser/MFormParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ private function createOptionElement(MFormItem $item, $key, $value, string $temp
}
}
/* Selected fix @skerbis @dtpop @MC-PMOE */
if ($item->multiple) {
if ($item->multiple && !is_null($item->stringValue)) {
$items_selected = json_decode($item->stringValue, true);

$current = explode('][', trim($item->varId, '[]'));
Expand Down

0 comments on commit 8e10958

Please sign in to comment.