{"record":{"id":"b8619516bac15ca0","repo":"octobercms/october","slug":"unable-to-find-a-usable-blueprint-in-import-export","errorCode":null,"errorMessage":"Unable to find a usable blueprint in import/export model.","messagePattern":"Unable to find a usable blueprint in import/export model\\.","errorType":"exception","errorClass":"SystemException","httpStatus":null,"severity":"error","filePath":"modules/tailor/traits/BlueprintModel.php","lineNumber":99,"sourceCode":"    }\n\n    /**\n     * resolveBlueprintModel\n     */\n    protected function resolveBlueprintModel()\n    {\n        $blueprint = $this->getBlueprintDefinition();\n\n        if ($blueprint instanceof GlobalBlueprint) {\n            return GlobalRecord::inGlobalUuid($this->blueprint_uuid);\n        }\n\n        if ($blueprint instanceof EntryBlueprint) {\n            $modelClass = $blueprint->getModelClassName();\n            return $modelClass::inSectionUuid($this->blueprint_uuid);\n        }\n\n        throw new SystemException('Unable to find a usable blueprint in import/export model.');\n    }\n}\n","sourceCodeStart":81,"sourceCodeEnd":102,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/tailor/traits/BlueprintModel.php#L81-L102","documentation":"Thrown by BlueprintModel's getRecordQuery() (the method that builds a query for import/export) when the resolved blueprint is neither a GlobalBlueprint nor an EntryBlueprint. The method branches on the blueprint type to return a scoped query; any other blueprint kind falls through to this SystemException, meaning the import/export model is bound to a blueprint type it cannot query.","triggerScenarios":"Binding an import/export model to a blueprint UUID that resolves to a non-entry, non-global blueprint (e.g. a mixin or repeater-related blueprint); a misconfigured blueprint_uuid that happens to collide with another blueprint type's UUID; custom blueprint classes that do not extend EntryBlueprint or GlobalBlueprint.","commonSituations":"Custom blueprint types introduced by plugins being attached to import/export models; copy-paste of import configurations between blueprint kinds; UUID mix-ups where an importer points at the wrong blueprint record.","solutions":["Point the import/export model at an entry section or global blueprint UUID — these are the only queryable kinds","Resolve the blueprint by handle at runtime to avoid pasting the wrong UUID","If you implemented a custom blueprint class, make it extend EntryBlueprint or GlobalBlueprint, or override getRecordQuery() in your model to provide a query"],"exampleFix":"// before: blueprint resolves to a non-queryable type\n$model->setBlueprintUuid($mixinOrWrongUuid);\n$query = $model->getRecordQuery();  // throws\n\n// after\n$blueprint = \\Tailor\\Classes\\BlueprintIndexer::instance()->findSectionByHandle('blog_post');\n$model->setBlueprintUuid($blueprint->uuid);  // EntryBlueprint\n$query = $model->getRecordQuery();","handlingStrategy":"validation","validationCode":"// Ensure the blueprint is a queryable kind before building the record query\n$blueprint = $model->getBlueprintDefinition();\nif (!$blueprint instanceof \\Tailor\\Classes\\Blueprint\\EntryBlueprint\n    && !$blueprint instanceof \\Tailor\\Classes\\Blueprint\\GlobalBlueprint) {\n    throw new InvalidArgumentException('Import/export requires an entry or global blueprint');\n}","typeGuard":"function isQueryableBlueprint(\\Tailor\\Classes\\Blueprint $blueprint): bool\n{\n    return $blueprint instanceof \\Tailor\\Classes\\Blueprint\\EntryBlueprint\n        || $blueprint instanceof \\Tailor\\Classes\\Blueprint\\GlobalBlueprint;\n}","tryCatchPattern":null,"preventionTips":["Only attach section or global blueprints to import/export models","If you define custom blueprint classes, override getRecordQuery() to provide your own query","Resolve blueprints by handle at runtime to avoid pointing at the wrong UUID/type"],"tags":["tailor","octobercms","blueprint","import-export","type-mismatch","query"],"backgroundTag":"unsupported-type-dispatch","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}