{"record":{"id":"c4fa7ffcebbd79b0","repo":"octobercms/october","slug":"missing-a-blueprint-definition-in-import-export-mo","errorCode":null,"errorMessage":"Missing a blueprint definition in import/export model.","messagePattern":"Missing a blueprint definition in import/export model\\.","errorType":"exception","errorClass":"SystemException","httpStatus":null,"severity":"error","filePath":"modules/tailor/traits/BlueprintModel.php","lineNumber":50,"sourceCode":"     * setBlueprintUuid\n     */\n    public function setBlueprintUuid($value)\n    {\n        $this->blueprint_uuid = $value;\n    }\n\n    /**\n     * getBlueprintDefinition\n     */\n    public function getBlueprintDefinition(): Blueprint\n    {\n        if ($this->blueprintCache !== null) {\n            return $this->blueprintCache;\n        }\n\n        $uuid = $this->blueprint_uuid;\n        if (!$uuid) {\n            throw new SystemException('Missing a blueprint definition in import/export model.');\n        }\n\n        $blueprint = BlueprintIndexer::instance()->find($uuid);\n        if (!$blueprint) {\n            throw new SystemException(sprintf('Unable to find import/export blueprint with ID \"%s\".', $uuid));\n        }\n\n        return $this->blueprintCache = $blueprint;\n    }\n\n    /**\n     * getContentFieldsetDefinition\n     */\n    public function getContentFieldsetDefinition(): Fieldset\n    {\n        $fieldset = BlueprintIndexer::instance()->findContentFieldset($this->blueprint_uuid);\n\n        if (!$fieldset) {","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/tailor/traits/BlueprintModel.php#L32-L68","documentation":"Thrown by the BlueprintModel trait's getBlueprintDefinition() (used by Tailor import/export models) when the model has no blueprint_uuid set. Import and export models must be bound to a blueprint before use; when the UUID attribute is empty a SystemException is raised with this message.","triggerScenarios":"Using an import/export model class that uses BlueprintModel without defining which blueprint it belongs to — i.e. blueprint_uuid is null because the model was instantiated outside its intended initialization path or the configuration was not applied.","commonSituations":"Custom classes adopting the BlueprintModel trait without implementing the required initialization; importers constructed before the blueprint was resolved; bugs in custom import/export workflows that skip the blueprint binding step.","solutions":["Ensure the import/export model is initialized through Tailor's import/export flow so the blueprint UUID is assigned","If writing a custom model with this trait, resolve and set blueprint_uuid (setBlueprintUuid) before calling blueprint-dependent methods","Check that the importer/exporter configuration references an existing section/global blueprint"],"exampleFix":"// before\n$model = new MyImportModel;\n$blueprint = $model->getBlueprintDefinition();  // throws\n\n// after\n$model = new MyImportModel;\n$model->setBlueprintUuid($blueprintUuid);\n$blueprint = $model->getBlueprintDefinition();","handlingStrategy":"validation","validationCode":"// Bind the blueprint before use\nif (empty($importModel->blueprint_uuid)) {\n    $importModel->setBlueprintUuid($resolvedBlueprintUuid);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Initialize import/export models through Tailor's import/export controller flow so the blueprint is bound","When using the BlueprintModel trait in custom classes, set the UUID in the constructor or boot path","Unit-test custom importers against a real synced blueprint"],"tags":["tailor","octobercms","blueprint","import-export","uuid","api-misuse"],"backgroundTag":"missing-parent-association","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}