Skip to content

Renderlet editable never sends parentDocumentId — useParams is empty inside the document editor iframe #216

Description

@Maxara

Affected Version

2026.2

Affected capability

Documents

Steps to reproduce

  1. Create an area brick with a renderlet editable whose controller reads the host document, e.g.:
    public function renderAction(Request $request): Response
    {
        $document = $request->attributes->get('contentDocument'); // null in Studio
        // pass $document to a template that requires it, e.g. a non-nullable Twig function argument
    }
  2. Drop a data object onto the renderlet in the Studio document editor.
  3. Observe GET /pimcore-studio/api/documents/renderlet/render?... — no parentDocumentId in the query string → controller receives no contentDocument → 500 if the template requires the document.
  4. Supplying parentDocumentId=<docId> on the same request (e.g. via the config workaround below) makes it succeed, since RenderletService::getAttributes() then calls ActionRenderer::addDocumentAttributes() which sets contentDocument.

Actual Behavior

parentDocumentId is missing from the request. Renderlet controllers that read $request->attributes->get('contentDocument') get null. Templates that need the host document (design/theming resolution, site context) throw, and the editable shows "error-loading-renderlet" with a 500.

Expected Behavior

The renderlet render request includes the id of the document being edited as parentDocumentId, matching what the Classic UI does (ExtJS sends pimcore_parentDocument with every renderlet request, and the admin RenderletController sets contentDocument from it). Note that the host document is not part of the documented renderlet controller contract (Renderlet docs only document id, type, subtype and custom config params) — but parentDocumentId exists as a dedicated parameter in the Studio API (RenderletParameter), Classic editmode has always provided the document, and frontend rendering provides it too, so the Studio editor is the only context where it's missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Platform Version

    2026.2

    Affected capability

    Documents

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions