octobercms/october · error · SystemException

Blueprint Model class

Error message

Blueprint Model class [{$customModelClass}] must extend the [{$modelClass}] base class

What it means

Guard in Blueprint::newModelInstance: the blueprint declares a custom modelClass, but that class does not extend the required base model class (the entry/form model for the blueprint type). The developer's custom model has the wrong inheritance hierarchy.

Solutions

  1. Make the custom model class extend the blueprint's base model class
  2. Remove modelClass to use the default model
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at modules/tailor/classes/Blueprint.php:704 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/a48874909abfbf3a. Report an issue: GitHub.

Appendix: source

Thrown at modules/tailor/classes/Blueprint.php:704

        }

        return "entry_{$this->handleSlug}";
    }

    /**
     * newModelInstance returns a new instance of the model associated with this blueprint
     */
    public function newModelInstance()
    {
        $modelClass = $this->getModelClassName();
        $customModelClass = $this->modelClass;

        if (!$customModelClass) {
            return new $modelClass;
        }

        if (!is_a($customModelClass, $modelClass, true)) {
            throw new SystemException("Blueprint Model class [{$customModelClass}] must extend the [{$modelClass}] base class");
        }

        return new $customModelClass;
    }

    /**
     * newCollection instance
     */
    public function newCollection(array $templates = []): BlueprintCollection
    {
        return new BlueprintCollection($templates);
    }

    /**
     * getRelativePath returns path relative to the theme template directory
     */
    protected function getRelativePath(string $path): string
    {

View on GitHub (pinned to b608633a7e)