octobercms/october · error · ApplicationException

List behavior used in :class does not have a model defined.

Error message

List behavior used in :class does not have a model defined.

What it means

validateModel guard in the Lists widget (called from init): before preparing the list it verifies that a model was bound. An empty model property means the controller's list configuration did not resolve a model (missing model in config or an unresolved record), so column definitions and queries cannot proceed. The placeholder :class names the controller for context.

Solutions

  1. Supply a valid model in the list configuration (modelClass or an injected model instance)
  2. Ensure the controller's list behavior config is loaded and the model class can be instantiated
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at modules/backend/widgets/Lists.php:360 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21). Data as JSON: /api/errors/8f560036fc35aaef. Report an issue: GitHub.

Appendix: source

Thrown at modules/backend/widgets/Lists.php:360

    }

    /**
     * onFilter event handler for changing the filter
     */
    public function onFilter()
    {
        $this->currentPageNumber = 1;

        return $this->onRefresh();
    }

    /**
     * validateModel is present and right class type
     */
    protected function validateModel()
    {
        if (!$this->model) {
            throw new ApplicationException(Lang::get(
                'backend::lang.list.missing_model',
                ['class'=>get_class($this->controller)]
            ));
        }

        if (!$this->model instanceof Model) {
            throw new ApplicationException(Lang::get(
                'backend::lang.model.invalid_class',
                ['model'=>get_class($this->model), 'class'=>get_class($this->controller)]
            ));
        }

        return $this->model;
    }

    /**
     * parseTableName replaces the @ symbol with a table name in a model
     * @param  string $sql

View on GitHub (pinned to b608633a7e)