Skip to content

Commit

Permalink
fix(actorfield): edition problem when switching question type from dr…
Browse files Browse the repository at this point in the history
…omdown / object
  • Loading branch information
btry committed Mar 17, 2022
1 parent d321c4d commit 0c83da0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions inc/field/actorfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,13 @@ public function serializeValue(): string {

public function deserializeValue($value) {
$deserialized = [];

$serialized = ($value !== null && $value !== '')
? json_decode($value, JSON_OBJECT_AS_ARRAY)
: [];
if (!is_array($serialized)) {
$serialized = [];
}
foreach ($serialized as $item) {
$item = trim($item);
if (filter_var($item, FILTER_VALIDATE_EMAIL) !== false) {
Expand Down

0 comments on commit 0c83da0

Please sign in to comment.