#110434PSR-14 event to add content around the record edit form
Description
The page module provides `ModifyPageLayoutContentEvent` to render additional content above and below the module body. The record list provides `RenderAdditionalContentToRecordListEvent` for the same purpose. There is no equivalent for the record edit form rendered by `EditDocumentController`.
`EditDocumentController` already dispatches three events (`BeforeFormEnginePageInitializedEvent`, `AfterFormEnginePageInitializedEvent`, `AfterRecordOpenedEvent`), but none of them allows rendering markup around the form. Extensions therefore fall back to a middleware that rewrites the response body, which is fragile and breaks on markup changes.
Use case: EXT:xima_typo3_content_planner shows an editorial status bar above the edit form. It currently does this via a response-manipulating middleware, while the same information is rendered through the proper event API in the page module and the record list.
Proposal: a new PSR-14 event, e.g. `ModifyEditDocumentContentEvent`, dispatched in `EditDocumentController::mainAction()` right before the body is assigned to the view. Scope intentionally narrow, mirroring `ModifyPageLayoutContentEvent`:
- header content, rendered above the form
- footer content, rendered below the form
- read access to the request and the `ModuleTemplate`
No interference with FormEngine internals, no access to the form result.
I am willing to provide the patch.
Reviews 1
Related issues 1
History 25
-
Konrad Michalik changed Related to #110435 <span data-processor="relativetime" data-value="2026-08-11T10:34:49+00:00" > 08/11/26, 10:34 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 95278 status
NewUnder Review <span data-processor="relativetime" data-value="2026-08-12T10:11:35+00:00" > 08/12/26, 10:11 </span> -
Konrad Michalik commented <span data-processor="relativetime" data-value="2026-08-12T10:40:17+00:00" > 08/12/26, 10:40 </span>
-
Gerrit Code Review pushed patch set 2 for main to change 95278 <span data-processor="relativetime" data-value="2026-08-12T12:51:52+00:00" > 08/12/26, 12:51 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 95278 <span data-processor="relativetime" data-value="2026-09-17T14:47:40+00:00" > 09/17/26, 14:47 </span>
Patch: https://review.typo3.org/c/Packages/TYPO3.CMS/+/95278
Two things turned out differently from the proposal above while implementing it.
Naming: the event is called
BeforeRecordEditFormIsRenderedEventinstead ofModifyEditDocumentContentEvent, following theBeforeXxx/AfterXxxscheme that is preferred for new events. The name is deliberately controller-neutral, which leads to the second point.Two dispatch points: the event is dispatched from both
EditDocumentControllerandContextualRecordEditController. Since 14.3 the contextual controller is the path taken when a record is edited from the page module,contextual-record-edit-trigger.tsopensrecord_edit_contextualin a sheet and only falls back torecord_editwhen the user settingcontextualRecordEditis disabled. An event inEditDocumentControlleralone would therefore have missed the main editing path, and it would not have replaced response manipulation either: a middleware matching on theeditquery parameter hits both routes today.Listeners that want to distinguish the two can read the route identifier:
Narrower API than proposed: the event exposes only
getRequest(), noModuleTemplate.ContextualRecordEdit.fluid.htmldoes not use the module layout and renders its own header, so doc header modifications would silently have no effect there and the API would behave differently depending on the route. For doc header buttonsModifyButtonBarEventis the right place. This makes the event identical in shape toRenderAdditionalContentToRecordListEvent. AddingModuleTemplatelater is possible, removing it would not be.Both routes are covered by functional tests, a changelog entry is included.