Issue Bug Resolved

#110502Form editor breaks on multi-step forms when another page contains a validation error

Stephan Ude 08/19/26, 13:33 updated 08/25/26, 11:15

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

  1. Josua Vogel commented and changed status Under Review Resolved done 0 % 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.