{"record":{"id":"cb90924a722daa71","repo":"octobercms/october","slug":"list-used-in-class-has-no-list-columns-defined","errorCode":null,"errorMessage":"List used in :class has no list columns defined.","messagePattern":"List used in :class has no list columns defined\\.","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/backend/widgets/Lists.php","lineNumber":970,"sourceCode":"     * defineListColumns builds an array of list columns with keys as the column name\n     * and values as a ListColumn object\n     */\n    protected function defineListColumns(): array\n    {\n        if (!isset($this->columns) || !is_array($this->columns)) {\n            $this->columns = [];\n        }\n\n        if ($this->columns) {\n            $this->addColumns($this->columns);\n        }\n        else {\n            $this->addColumnsFromModel();\n        }\n\n        if (!$this->allColumns) {\n            $class = get_class($this->model instanceof Model ? $this->model : $this->controller);\n            throw new ApplicationException(Lang::get('backend::lang.list.missing_columns', compact('class')));\n        }\n\n        /**\n         * @event backend.list.extendColumns\n         * Provides an opportunity to modify the columns of a List widget\n         *\n         * Example usage:\n         *\n         *     Event::listen('backend.list.extendColumns', function ($listWidget) {\n         *         // Only for the User controller\n         *         if (!$listWidget->getController() instanceof \\Backend\\Controllers\\Users) {\n         *             return;\n         *         }\n         *\n         *         // Only for the User model\n         *         if (!$listWidget->model instanceof \\Backend\\Models\\User) {\n         *             return;\n         *         }","sourceCodeStart":952,"sourceCodeEnd":988,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/backend/widgets/Lists.php#L952-L988","documentation":"Final guard in defineListColumns: after merging columns from the config and from the model's field definitions, the widget checks that at least one column was registered. An empty allColumns means neither the list config nor the model supplied any column definitions, leaving nothing to render; the message names the responsible class.","triggerScenarios":"Thrown at modules/backend/widgets/Lists.php:970 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a columns section to the list configuration (config_list.yaml)","Define list columns on the model so addColumnsFromModel can discover them","Verify the list config file is being loaded at all (correct path and alias)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","contentChangedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}