From f70a84725da99d14980a69e9af7c258bf406dafd Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Tue, 21 Jul 2020 08:44:39 +0200 Subject: [PATCH] fix(filefield): broken mandatory check Signed-off-by: Thierry Bugier --- inc/fields/filefield.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/fields/filefield.class.php b/inc/fields/filefield.class.php index 11474fa54..bfd162eef 100644 --- a/inc/fields/filefield.class.php +++ b/inc/fields/filefield.class.php @@ -128,7 +128,8 @@ public function isValid() { private function isValidValue($value) { // If the field is required it can't be empty - return (count($this->uploadData) > 0); + $key = 'formcreator_field_' . $this->question->getID(); + return (count($this->uploads["_$key"]) > 0); } public static function getName() {