octobercms/october · error · ApplicationException

Model :model used in :class is not valid, it must inherit th

Error message

Model :model used in :class is not valid, it must inherit the \Model class.

What it means

Error "Model :model used in :class is not valid, it must inherit the \Model class." thrown in octobercms/october.

Source

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

        $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
     * @param  string $table
     * @return string
     */
    protected function parseTableName($sql, $table)
    {
        return str_replace('@', $table.'.', $sql);
    }

View on GitHub (pinned to b608633a7e)

When it happens

Trigger: Thrown at modules/backend/widgets/Lists.php:367 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/ca61375ca760514f. Report an issue: GitHub.