Skip to content

Commit

Permalink
API Rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Nov 12, 2024
1 parent 15be53e commit d481ac2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion code/elemental/ElementContentExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ElementContentExtension extends Extension
'MyFile' => File::class,
];

protected function updatevalidate(ValidationResult $result)
protected function updateValidate(ValidationResult $result)
{
if ($this->owner->Title == 'x') {
$result->addFieldError('Title', 'Title cannot be x');
Expand Down
5 changes: 3 additions & 2 deletions code/elemental/NumericFieldExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@

use SilverStripe\Forms\NumericField;
use SilverStripe\Core\Extension;
use SilverStripe\Core\Validation\ValidationResult;

/**
* @extends Extension<NumericField>
*/
class NumericFieldExtension extends Extension
{
protected function updateValidationResult($result, $validator)
protected function updateValidate(ValidationResult $result)
{
if ($this->owner->Value() == 1) {
$validator->validationError($this->owner->getName(), 'This field cannot be 1');
$result->addFieldError($this->owner->getName(), 'This field cannot be 1');
}
}
}

0 comments on commit d481ac2

Please sign in to comment.