Skip to content

Commit e3ba89b

Browse files
committed
List columns don't support morphTo (yet)
1 parent 5ca55e1 commit e3ba89b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

modules/backend/widgets/Lists.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,14 @@ public function prepareModel()
415415
* Relation column
416416
*/
417417
if (isset($column->relation)) {
418-
$table = $this->model->makeRelation($column->relation)->getTable();
418+
419+
// @todo Find a way...
419420
$relationType = $this->model->getRelationType($column->relation);
421+
if ($relationType == 'morphTo') {
422+
throw new ApplicationException('The relationship morphTo is not supported for list columns.');
423+
}
424+
425+
$table = $this->model->makeRelation($column->relation)->getTable();
420426
$sqlSelect = $this->parseTableName($column->sqlSelect, $table);
421427

422428
/*

0 commit comments

Comments
 (0)