Merge pull request #3943 from patricknelson/3.1

FIX: Ensuring GridFieldDetailForm validator uses Object->hasMethod() to respect e...
This commit is contained in:
Daniel Hensby 2015-03-09 18:59:40 +00:00
commit 59496be8eb

View File

@ -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());
}