mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
Merge pull request #510 from kinglozzer/formfield-validation-extensions
NEW: Add extension hook for field-specific validation
This commit is contained in:
commit
de2a8998bf
@ -17,7 +17,7 @@ class WildcardDomainField extends TextField
|
|||||||
public function validate($validator)
|
public function validate($validator)
|
||||||
{
|
{
|
||||||
if ($this->checkHostname($this->Value())) {
|
if ($this->checkHostname($this->Value())) {
|
||||||
return true;
|
return $this->extendValidationResult(true, $validator);
|
||||||
}
|
}
|
||||||
|
|
||||||
$validator->validationError(
|
$validator->validationError(
|
||||||
@ -25,7 +25,7 @@ class WildcardDomainField extends TextField
|
|||||||
_t('DomainNameField.INVALID_DOMAIN', 'Invalid domain name'),
|
_t('DomainNameField.INVALID_DOMAIN', 'Invalid domain name'),
|
||||||
'validation'
|
'validation'
|
||||||
);
|
);
|
||||||
return false;
|
return $this->extendValidationResult(false, $validator);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user