Issue Task Resolved

#111507Make the form editor null-safe

Benjamin Kott 11/19/26, 12:05 updated 11/19/26, 14:15

Description

The JavaScript of the form editor, the form manager and the form wizard reads values that can be missing at runtime without a check. Unlike the other backend modules it barely touches the DOM directly, so the errors do not come from element lookups.

The editor’s modules keep their state in file-level singletons that a bootstrap call assigns – the editor application, the configuration, the view model, the stage element – and declare them as if they were always set. The application state stack hands out undefined for every key, although each entry is seeded when a state is pushed. Most of the remaining places are optional properties of the editor configuration, which only the renderer selected for exactly that template ever reads: the configuration options of an editor, its select options, its view ports, the property collections of an element definition.

Some declarations are plainly wrong. createFormElement, buildPropertyPath, renderAbstractStageArea, createAndAddAbstractViewFormElementToolbar and addValidatorIdentifiersToFormElementProperty handle a missing argument in their first lines, yet declare those parameters as required, so every caller passes undefined into a type that does not admit it.

These places should get a guard or a fallback where the value can really be missing, and a correct declaration where it was wrong, so form compiles under strictNullChecks.

Reviews 2

History 14

  1. Benjamin Kott commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-11-19T14:15:14+00:00" > 11/19/26, 14:15 </span>

    Applied in changeset commit:32ffa6ff40866800714cca14e6248289a1be33ea.