mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #8905 from sminnee/fix-3519
FIX: Better error message when GridFieldLevelup passed bad record details
This commit is contained in:
commit
761d4d877e
@ -62,6 +62,11 @@ class GridFieldLevelup implements GridField_HTMLProvider
|
|||||||
|
|
||||||
/** @var DataObject|Hierarchy $modelObj */
|
/** @var DataObject|Hierarchy $modelObj */
|
||||||
$modelObj = DataObject::get_by_id($modelClass, $this->currentID);
|
$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;
|
$parent = null;
|
||||||
if ($modelObj->hasMethod('getParent')) {
|
if ($modelObj->hasMethod('getParent')) {
|
||||||
|
Loading…
Reference in New Issue
Block a user