#110502Form editor breaks on multi-step forms when another page contains a validation error
Description
Problem
Opening or navigating a multi-step form in the form editor throws
> TypeError: Cannot read properties of null (reading ‘querySelector’)
as soon as any form element on a non-displayed page has a failing property validation. The exception escapes the publisher/subscriber callback, so the remaining calls in the handler (pagination, inspector, selection) never run and the editor is left unusable.
Steps to reproduce
1. Create a new blank form.
2. Add a second step.
3. On step 2, add a “Multi checkbox” element and do not add any options (its properties.options editor has a NotEmpty property validator, so the element is now invalid).
4. Use the pagination arrow in the stage header to go back to step 1.
→ JavaScript error in the console, editor no longer usable.
Expected : page 1 is displayed; the invalid element on page 2 is marked in the structure tree (which already works) and simply not marked in the stage, since it is not rendered there.
Cause
ViewModel.addAbstractViewValidationResults() (Build/Sources/TypeScript/form/backend/form-editor/view-model.ts:805 on 14.3) iterates the recursive validation results of the whole form and dereferences the stage DOM element without a null check:
const validationElement = getStage().getAbstractViewFormElementDomElement(
validationResults[i].formElementIdentifierPath
);
const stageItem = validationElement.querySelector('typo3-form-form-element-stage-item');
Stage.getAbstractViewFormElementDomElement() (stage-component.ts:485) is declared HTMLElement | null and queries only the stage DOM, which holds exclusively the currently rendered page. For elements on any other page it therefore returns null.
Suggested fix
- const stageItem = validationElement.querySelector('typo3-form-form-element-stage-item') as HTMLElement | null;
+ const stageItem = validationElement?.querySelector('typo3-form-form-element-stage-item') as HTMLElement | null;Reviews 2
History 27
-
Josua Vogel changed assigned to Josua Vogel <span data-processor="relativetime" data-value="2026-08-20T12:05:59+00:00" > 08/20/26, 12:05 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 95392 status
NewUnder Review <span data-processor="relativetime" data-value="2026-08-23T17:40:36+00:00" > 08/23/26, 17:40 </span> -
Gerrit Code Review pushed patch set 2 for main to change 95392 <span data-processor="relativetime" data-value="2026-08-23T17:40:47+00:00" > 08/23/26, 17:40 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 95392 <span data-processor="relativetime" data-value="2026-08-23T21:33:56+00:00" > 08/23/26, 21:33 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 95412 <span data-processor="relativetime" data-value="2026-08-25T10:56:47+00:00" > 08/25/26, 10:56 </span>
-
Gerrit Code Review pushed patch set 2 for 14.3 to change 95412 <span data-processor="relativetime" data-value="2026-08-25T11:02:43+00:00" > 08/25/26, 11:02 </span>
-
Josua Vogel commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-08-25T11:15:16+00:00" > 08/25/26, 11:15 </span>
Applied in changeset commit:0a625346e14885deae62c2c0150fd15fbcdede37.