Skip to content

Commit f449aca

Browse files
committed
fix(filefield): broken mandatory check
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
1 parent b3a250f commit f449aca

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

inc/fields/filefield.class.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ public function isValid() {
133133
}
134134

135135
public function isValidValue($value) {
136-
return true;
136+
// If the field is required it can't be empty
137+
$key = 'formcreator_field_' . $this->question->getID();
138+
return (count($this->uploads["_$key"]) > 0);
137139
}
138140

139141
public static function getName() {

0 commit comments

Comments
 (0)