{"record":{"id":"2bcaf9af2dc96aa8","repo":"octobercms/october","slug":"the-relationship-morphto-is-not-supported-for-list","errorCode":null,"errorMessage":"The relationship morphTo is not supported for list columns.","messagePattern":"The relationship morphTo is not supported for list columns\\.","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/backend/widgets/Lists.php","lineNumber":516,"sourceCode":"            }\n\n            // Allow extensions inside the search grouping\n            $this->fireSystemEvent('backend.list.extendSearchQuery', [$innerQuery]);\n        });\n\n        // Custom select queries\n        foreach ($this->getVisibleColumns() as $column) {\n            if (!$column->sqlSelect) {\n                continue;\n            }\n\n            $alias = $query->getQuery()->getGrammar()->wrap($column->columnName);\n\n            // Relation column\n            if ($column->relation) {\n                $relationType = $this->model->getRelationType($column->relation);\n                if ($relationType === 'morphTo') {\n                    throw new ApplicationException('The relationship morphTo is not supported for list columns.');\n                }\n\n                $table = $this->model->makeRelation($column->relation)->getTable();\n                $sqlSelect = $this->parseTableName($column->sqlSelect, $table);\n\n                // Manipulate a count query for the sub query\n                $relationObj = $this->model->{$column->relation}();\n                $relationQuery = $relationObj->getRelated()->newQuery();\n\n                // Apply related constraints to the sub query\n                // Possibility: the column could contribute to this via conditions or scope\n                $relationObj->addDefinedConstraintsToQuery($relationQuery);\n\n                $countQuery = $relationObj->getRelationExistenceQuery($relationQuery, $query);\n\n                $isMultiRelation = $this->isColumnRelated($column, true);\n\n                $joinSql = $isMultiRelation","sourceCodeStart":498,"sourceCodeEnd":534,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/backend/widgets/Lists.php#L498-L534","documentation":"Error \"The relationship morphTo is not supported for list columns.\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/backend/widgets/Lists.php:516 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}