Merge pull request #10937 from creative-commoners/pulls/5.0/fix-validation

FIX Call Textarea validation extension
This commit is contained in:
Guy Sartorelli 2023-09-07 09:13:05 +12:00 committed by GitHub
commit 2c9beab760
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -174,6 +174,7 @@ class TextareaField extends FormField
*/ */
public function validate($validator) public function validate($validator)
{ {
$result = true;
if (!is_null($this->maxLength) && mb_strlen($this->value ?? '') > $this->maxLength) { if (!is_null($this->maxLength) && mb_strlen($this->value ?? '') > $this->maxLength) {
$name = strip_tags($this->Title() ? $this->Title() : $this->getName()); $name = strip_tags($this->Title() ? $this->Title() : $this->getName());
$validator->validationError( $validator->validationError(
@ -185,9 +186,9 @@ class TextareaField extends FormField
), ),
"validation" "validation"
); );
return false; $result = false;
} }
return true; return $this->extendValidationResult($result, $validator);
} }
public function getSchemaValidation() public function getSchemaValidation()