Skip to content

Commit 6f56484

Browse files
committed
fix(filefield): null passed to json_decode deprecated
1 parent 8cb1bc3 commit 6f56484

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

inc/field/filefield.class.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,15 @@ public function serializeValue(): string {
100100
}
101101

102102
public function deserializeValue($value) {
103+
$this->uploadData = [];
104+
$this->value = __('No attached document', 'formcreator');
105+
if ($value === null) {
106+
return;
107+
}
103108
$this->uploadData = json_decode($value, true);
104109
if ($this->uploadData === null) {
105110
$this->uploadData = [];
106111
}
107-
$this->value = __('No attached document', 'formcreator');;
108112
if (count($this->uploadData) > 0) {
109113
$this->value = __('Attached document', 'formcreator');
110114
}

0 commit comments

Comments
 (0)