octobercms/october · error · SystemException
Document data is not provided
Error message
Document data is not provided
What it means
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.
Source
Thrown at modules/tailor/classes/editorextension/HasExtensionCrud.php:30
use Editor\Classes\ApiHelpers;
use Tailor\Classes\BlueprintIndexer;
use Tailor\Classes\BlueprintVerifier;
use Tailor\Classes\BlueprintException;
use Tailor\Classes\BlueprintErrorData;
/**
* HasExtensionCrud implements CRUD operations for the Tailor Editor Extension
*/
trait HasExtensionCrud
{
/**
* command_onOpenDocument
*/
protected function command_onOpenDocument()
{
$documentData = post('documentData');
if (!is_array($documentData)) {
throw new SystemException('Document data is not provided');
}
$key = ApiHelpers::assertGetKey($documentData, 'key');
$documentType = ApiHelpers::assertGetKey($documentData, 'type');
$this->assertDocumentTypePermissions($documentType);
$extraData = $this->getRequestExtraData();
$isResetFromTemplateFileRequest = isset($extraData['resetFromTemplateFile']);
if ($isResetFromTemplateFileRequest) {
$this->resetFromTemplateFile($documentType, $key);
}
$template = $this->loadTemplate($documentType, $key);
$templateData = [
'content' => $template->content,
'fileName' => ltrim($template->fileName, '/')
];View on GitHub (pinned to b608633a7e)
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.
Example fix
// before (missing payload)
$.request('onEditorOpenDocument');
// after
$.request('onEditorOpenDocument', {
data: { documentData: { key: 'blueprints/blog/posts.yaml', type: 'tailor-blueprint' } }
}); Defensive patterns
Strategy: validation
Validate before calling
// Client side: always send the expected payload shape
const payload = { documentData: { key: path, type: 'tailor-blueprint' } };
$.request('onEditorCommand', { data: { command: 'onOpenDocument', ...payload } }); Try / catch
try {
// invoke editor extension open command
} catch (\SystemException $e) {
// payload missing documentData — rebuild request from the document's key/type and retry once
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Invalid documentMetadata
- Invalid documentData
- Custom widget class [{$widgetClass}] is not set.
- The property name is not specified.
- Custom widget class [{$widgetClass}] is not set.
AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21).
Data as JSON: /api/errors/ab2d3925fc8e8ca2.
Report an issue: GitHub.