mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX: Better error message when GridFieldLevelup passed bad record details
Fixes https://github.com/silverstripe/silverstripe-framework/issues/3519
This commit is contained in:
parent
d295888838
commit
f12fa62ad6
@ -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