Merge pull request #8905 from sminnee/fix-3519

FIX: Better error message when GridFieldLevelup passed bad record details
This commit is contained in:
Robbie Averill 2019-04-09 09:01:33 +12:00 committed by GitHub
commit 761d4d877e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,6 +62,11 @@ class GridFieldLevelup implements GridField_HTMLProvider
/** @var DataObject|Hierarchy $modelObj */
$modelObj = DataObject::get_by_id($modelClass, $this->currentID);
if (!$modelObj) {
throw new \LogicException(
"Can't find object of class $modelClass ID #{$this->currentID} for GridFieldLevelup"
);
}
$parent = null;
if ($modelObj->hasMethod('getParent')) {