{"record":{"id":"ab2d3925fc8e8ca2","repo":"octobercms/october","slug":"document-data-is-not-provided-ab2d39","errorCode":null,"errorMessage":"Document data is not provided","messagePattern":"Document data is not provided","errorType":"exception","errorClass":"SystemException","httpStatus":null,"severity":"error","filePath":"modules/tailor/classes/editorextension/HasExtensionCrud.php","lineNumber":30,"sourceCode":"use Editor\\Classes\\ApiHelpers;\nuse Tailor\\Classes\\BlueprintIndexer;\nuse Tailor\\Classes\\BlueprintVerifier;\nuse Tailor\\Classes\\BlueprintException;\nuse Tailor\\Classes\\BlueprintErrorData;\n\n/**\n * HasExtensionCrud implements CRUD operations for the Tailor Editor Extension\n */\ntrait HasExtensionCrud\n{\n    /**\n     * command_onOpenDocument\n     */\n    protected function command_onOpenDocument()\n    {\n        $documentData = post('documentData');\n        if (!is_array($documentData)) {\n            throw new SystemException('Document data is not provided');\n        }\n\n        $key = ApiHelpers::assertGetKey($documentData, 'key');\n        $documentType = ApiHelpers::assertGetKey($documentData, 'type');\n        $this->assertDocumentTypePermissions($documentType);\n\n        $extraData = $this->getRequestExtraData();\n\n        $isResetFromTemplateFileRequest = isset($extraData['resetFromTemplateFile']);\n        if ($isResetFromTemplateFileRequest) {\n            $this->resetFromTemplateFile($documentType, $key);\n        }\n\n        $template = $this->loadTemplate($documentType, $key);\n        $templateData = [\n            'content' => $template->content,\n            'fileName' => ltrim($template->fileName, '/')\n        ];","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/tailor/classes/editorextension/HasExtensionCrud.php#L12-L48","documentation":"command_onOpenDocument() is the AJAX handler the October editor extension client invokes when a document is opened. It requires a `documentData` array in the POST body (with at least `key` and `type`). If post('documentData') is missing or not an array, it throws SystemException('Document data is not provided') before doing any work.","triggerScenarios":"POSTing to the editor extension endpoint without a documentData payload; sending documentData as a raw JSON string instead of a parsed array; a custom client or automated test hitting the handler directly with an incomplete body.","commonSituations":"Custom integrations with the editor extension; stale editor frontend assets after a CMS upgrade sending a changed payload shape; test fixtures built for an older payload format.","solutions":["Send documentData as an array containing at least key and type, e.g. documentData[key]=blog/posts.yaml&documentData[type]=tailor-blueprint.","After upgrading October, clear browser/CDN caches so the editor client sends the current payload shape.","Confirm the request reaches the intended tailor handler and is not being redirected or stripped by middleware."],"exampleFix":"// before (missing payload)\n$.request('onEditorOpenDocument');\n\n// after\n$.request('onEditorOpenDocument', {\n    data: { documentData: { key: 'blueprints/blog/posts.yaml', type: 'tailor-blueprint' } }\n});","handlingStrategy":"validation","validationCode":"// Client side: always send the expected payload shape\nconst payload = { documentData: { key: path, type: 'tailor-blueprint' } };\n$.request('onEditorCommand', { data: { command: 'onOpenDocument', ...payload } });","typeGuard":null,"tryCatchPattern":"try {\n    // invoke editor extension open command\n} catch (\\SystemException $e) {\n    // payload missing documentData — rebuild request from the document's key/type and retry once\n}","preventionTips":["When integrating with the editor extension, replicate the exact payloads the core client sends (documentData.key, documentData.type).","Add contract tests for custom AJAX handlers asserting required payload keys.","Clear cached editor assets after CMS upgrades."],"tags":["tailor","editor-extension","ajax","request-payload"],"backgroundTag":"missing-request-payload","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}