Problem
Opening a module that extends AbstractBackendController with the default WORKSPACE_ID = 0 throws on every page load:
Uncaught TypeError: Cannot read properties of undefined (reading 'formName') at form-engine.js
Root Cause
AbstractBackendController::loadWorkspaceScripts() only registers the FormEngine inline setting inside the if ($this::WORKSPACE_ID) branch.
However, Resources/Public/JavaScript/recordlist-row-edit-multiple.js uses top.TYPO3.settings.FormEngine.moduleUrl unconditionally and pulls @typo3/backend/form-engine.js as a transitive dependency. form-engine.js reads TYPO3.settings.FormEngine.formName at module-evaluation time, so it throws when the setting is missing.
Fix
Move the two FormEngine inline settings out of the workspace branch — they are required by the row-edit JS regardless of workspace mode. Workspaces, RecordHistory and WebLayout stay workspace-only.
protected function loadWorkspaceScripts(): void
{
+ $this->pageRenderer->addInlineSetting(
+ 'FormEngine',
+ 'moduleUrl',
+ (string)$this->backendUriBuilder->buildUriFromRoute('record_edit')
+ );
+ $this->pageRenderer->addInlineSetting('FormEngine', 'formName', 'editform');
+
if ($this::WORKSPACE_ID) {
- $this->pageRenderer->addInlineSetting(
- 'FormEngine',
- 'moduleUrl',
- (string)$this->backendUriBuilder->buildUriFromRoute('record_edit')
- );
// ...
}
}
Environment
- TYPO3 v13.4
- xima/xima-typo3-recordlist 14.0.0
- PHP 8.4
Problem
Opening a module that extends
AbstractBackendControllerwith the defaultWORKSPACE_ID = 0throws on every page load:Root Cause
AbstractBackendController::loadWorkspaceScripts()only registers theFormEngineinline setting inside theif ($this::WORKSPACE_ID)branch.However,
Resources/Public/JavaScript/recordlist-row-edit-multiple.jsusestop.TYPO3.settings.FormEngine.moduleUrlunconditionally and pulls@typo3/backend/form-engine.jsas a transitive dependency.form-engine.jsreadsTYPO3.settings.FormEngine.formNameat module-evaluation time, so it throws when the setting is missing.Fix
Move the two
FormEngineinline settings out of the workspace branch — they are required by the row-edit JS regardless of workspace mode.Workspaces,RecordHistoryandWebLayoutstay workspace-only.protected function loadWorkspaceScripts(): void { + $this->pageRenderer->addInlineSetting( + 'FormEngine', + 'moduleUrl', + (string)$this->backendUriBuilder->buildUriFromRoute('record_edit') + ); + $this->pageRenderer->addInlineSetting('FormEngine', 'formName', 'editform'); + if ($this::WORKSPACE_ID) { - $this->pageRenderer->addInlineSetting( - 'FormEngine', - 'moduleUrl', - (string)$this->backendUriBuilder->buildUriFromRoute('record_edit') - ); // ... } }Environment