octobercms/october · error · ApplicationException

Model ':class' does not contain a method ':method'.

Error message

Model ':class' does not contain a method ':method'.

What it means

Error "Model ':class' does not contain a method ':method'." thrown in octobercms/october.

Source

Thrown at modules/backend/formwidgets/datatable/LegacyDataTable.php:113

        $config->alias = studly_case(HtmlHelper::nameToId($fieldName)) . 'datatable';
        $config->fieldName = $fieldName;

        $table = new Table($this->controller, $config);
        $table->bindEvent('table.getDropdownOptions', [$this, 'getLegacyDataTableOptions']);
        $table->bindEvent('table.getAutocompleteOptions', [$this, 'getLegacyDataTableOptions']);

        return $table;
    }

    /**
     * getLegacyDataTableOptions is the legacy dropdown/autocomplete option callback handler
     */
    public function getLegacyDataTableOptions($columnName, $rowData)
    {
        $methodName = 'get' . studly_case($this->fieldName) . 'DataTableOptions';

        if (!$this->model->methodExists($methodName) && !$this->model->methodExists('getDataTableOptions')) {
            throw new ApplicationException(
                Lang::get(
                    'backend::lang.model.missing_method',
                    [
                        'class' => get_class($this->model),
                        'method' => 'getDataTableOptions'
                    ]
                )
            );
        }

        if ($this->model->methodExists($methodName)) {
            $result = $this->model->$methodName($columnName, $rowData);
        }
        else {
            $result = $this->model->getDataTableOptions($this->fieldName, $columnName, $rowData);
        }

        if (!is_array($result)) {

View on GitHub (pinned to b608633a7e)

When it happens

Trigger: Thrown at modules/backend/formwidgets/datatable/LegacyDataTable.php:113 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/ab61e28ecfff8cb9. Report an issue: GitHub.