{"record":{"id":"df6eeb646d310b6c","repo":"octobercms/october","slug":"blueprint-not-found","errorCode":null,"errorMessage":"Blueprint not found","messagePattern":"Blueprint not found","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/tailor/classes/editorextension/HasExtensionCrud.php","lineNumber":215,"sourceCode":"    protected function command_onBlueprintUpload()\n    {\n        $this->assertBlueprintPermissions();\n\n        $this->editorUploadFiles($this->getBlueprintsPath(), ['yaml']);\n    }\n\n    /**\n     * loadTemplate returns an existing template of a given type\n     * @param string $documentType\n     * @param string $path\n     * @return mixed\n     */\n    private function loadTemplate($documentType, $path)\n    {\n        $class = $this->resolveTypeClassName($documentType);\n\n        if (!($template = call_user_func([$class, 'load'], $path))) {\n            throw new ApplicationException(trans('tailor::lang.blueprint.not_found'));\n        }\n\n        return $template;\n    }\n\n    /**\n     * resolveTypeClassName resolves a template type to its class name\n     * @param string $documentType\n     * @return string\n     */\n    private function resolveTypeClassName($documentType)\n    {\n        $types = [\n            EditorExtension::DOCUMENT_TYPE_BLUEPRINT => Blueprint::class,\n            EditorExtension::DOCUMENT_TYPE_THEME_BLUEPRINT => ThemeBlueprint::class\n        ];\n\n        if (!array_key_exists($documentType, $types)) {","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/tailor/classes/editorextension/HasExtensionCrud.php#L197-L233","documentation":"loadTemplate() resolves the document type to the Blueprint or ThemeBlueprint class and calls load($path); a null return means no blueprint file matches that path. The handler converts this into an ApplicationException carrying the tailor::lang.blueprint.not_found message, which is surfaced to the editor user.","triggerScenarios":"Opening or saving a blueprint in the editor whose path no longer exists — the file was deleted or renamed on disk, the path went stale after moving blueprints between themes, or the editor client cached an outdated document path.","commonSituations":"Another editor or a git branch switch deleted/renamed the file while the document was open; renaming a blueprint directory; programmatic CRUD calls with hardcoded paths after a refactor.","solutions":["Reload the blueprint list in the editor so stale paths disappear, then re-open the file under its current name/path.","If the file was deleted unintentionally, restore it from VCS or backup and retry.","For programmatic calls, verify the file exists (or handle a null return from load()) before issuing open/save commands."],"exampleFix":"// before\n$template = $this->loadTemplate($documentType, $path);\n\n// after\nif (!file_exists(base_path($path))) {\n    throw new ApplicationException('Blueprint file no longer exists: ' . $path);\n}\n$template = $this->loadTemplate($documentType, $path);","handlingStrategy":"try-catch","validationCode":"if (!call_user_func([$class, 'load'], $path)) {\n    // path stale — refresh the document list instead of proceeding\n}","typeGuard":null,"tryCatchPattern":"try {\n    $template = $this->loadTemplate($documentType, $path);\n} catch (\\October\\Rain\\Exception\\ApplicationException $e) {\n    // blueprint file gone: sync the file list, surface 'not found' to the user, offer to reload\n}","preventionTips":["Handle file deletions/renames in the editor by reloading the blueprint tree.","In custom integrations, check the blueprint file exists before issuing open/save commands.","Use VCS so accidentally deleted blueprint files can be restored."],"tags":["tailor","editor-extension","blueprint","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}