octobercms/october · error · SystemException

The attribute ':field' does not resolve to a valid model. Tr

Error message

The attribute ':field' does not resolve to a valid model. Try specifying the options method for model class :model explicitly.

What it means

Error "The attribute ':field' does not resolve to a valid model. Try specifying the options method for model class :model explicitly." thrown in octobercms/october.

Source

Thrown at modules/backend/classes/FormField.php:567

                ]));
            }

            $fieldOptions = $model->$methodName($this->value, $this->fieldName, $data);
        }

        return $fieldOptions;
    }

    /**
     * getOptionsFromModelAsDefault refers to the model method or any of its behaviors
     */
    protected function getOptionsFromModelAsDefault($model, $data)
    {
        try {
            [$model, $attribute] = $this->resolveModelAttributeInternal($model, $this->fieldName, ['objectOnly' => true]);
        }
        catch (Exception $ex) {
            throw new SystemException(Lang::get('backend::lang.field.options_method_invalid_model', [
                'model' => get_class($model),
                'field' => $this->fieldName
            ]));
        }

        $methodName = 'get'.studly_case($attribute).'Options';
        if (
            !$this->objectMethodExists($model, $methodName) &&
            !$this->objectMethodExists($model, 'getDropdownOptions')
        ) {
            throw new SystemException(Lang::get('backend::lang.field.options_method_not_exists', [
                'model' => get_class($model),
                'method' => $methodName,
                'field' => $this->fieldName
            ]));
        }

        if ($this->objectMethodExists($model, $methodName)) {

View on GitHub (pinned to b608633a7e)

When it happens

Trigger: Thrown at modules/backend/classes/FormField.php:567 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/e09ac0a7020ee400. Report an issue: GitHub.