mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
FIX: Ensuring custom CMS validator uses Object->hasMethod() to respect extension decorator pattern.
This commit is contained in:
parent
fcf0e8980a
commit
f5f41b2f0e
@ -95,7 +95,7 @@ class GridFieldDetailForm implements GridField_URLHandler {
|
||||
|
||||
// if no validator has been set on the GridField and the record has a
|
||||
// CMS validator, use that.
|
||||
if(!$this->getValidator() && method_exists($record, 'getCMSValidator')) {
|
||||
if(!$this->getValidator() && (method_exists($record, 'getCMSValidator') || $record instanceof Object && $record->hasMethod('getCMSValidator'))) {
|
||||
$this->setValidator($record->getCMSValidator());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user