Merge pull request #8979 from silverstripe-terraformers/feature/add-extension-for-schema-validation

Add extend function in getSchemaValidation function
This commit is contained in:
Robbie Averill 2019-05-16 11:22:45 +12:00 committed by GitHub
commit 32c04ce765
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1609,9 +1609,11 @@ class FormField extends RequestHandler
*/
public function getSchemaValidation()
{
$validationList = [];
if ($this->Required()) {
return [ 'required' => true ];
$validationList['required'] = true;
}
return [];
$this->extend('updateSchemaValidation', $validationList);
return $validationList;
}
}