mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Add deprecation notice for 4.6 and update docs
This commit is contained in:
parent
f977f9734c
commit
11e2005b9b
@ -274,9 +274,10 @@ class MyController extends Controller
|
||||
### Validation in the CMS
|
||||
|
||||
In the CMS, we're not creating the forms for editing CMS records. The `Form` instance is generated for us so we cannot
|
||||
call `setValidator` easily. However, a `DataObject` can provide its' own `Validator` instance through the
|
||||
`getCMSValidator()` method. The CMS interfaces such as [LeftAndMain](api:SilverStripe\Admin\LeftAndMain), [ModelAdmin](api:SilverStripe\Admin\ModelAdmin) and [GridField](api:SilverStripe\Forms\GridField\GridField) will
|
||||
respect the provided `Validator` and handle displaying error and success responses to the user.
|
||||
call `setValidator` easily. However, a `DataObject` can provide its' own `Validator` instance/s through the
|
||||
`getValidatorList()` method. The CMS interfaces such as [LeftAndMain](api:SilverStripe\Admin\LeftAndMain),
|
||||
[ModelAdmin](api:SilverStripe\Admin\ModelAdmin) and [GridField](api:SilverStripe\Forms\GridField\GridField) will
|
||||
respect the provided `Validator`/s and handle displaying error and success responses to the user.
|
||||
|
||||
[info]
|
||||
Again, custom error messages can be provided through the `FormField`
|
||||
|
@ -2457,6 +2457,11 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
||||
|
||||
// Support for the old method during the deprecation period
|
||||
if ($this->hasMethod('getCMSValidator')) {
|
||||
Deprecation::notice(
|
||||
'4.6',
|
||||
'getCMSValidator() is removed in 5.0 in favour of getValidatorList()'
|
||||
);
|
||||
|
||||
$validatorList->addValidator($this->getCMSValidator());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user