Skip to content

Reporting misconfigured handlers #312

Open

Description

@jekuaitk

Description

Some handlers require configuration depending on elements. While they cannot be saved with incorrect configuration the elements referenced may be subject to modification (or removal) resulting in misconfigured handlers and failing jobs.

Steps to reproduce

We use the Digital Post-handler as an example:

  1. Create webform
  2. Add NemId CPR-element with key/id recipient intended for CPR/CVR
  3. Add other elements
  4. Add and configure OS2Forms Attachment-element
  5. Add and configure the Digital Post-handler correctly with above elements

New digital post handler jobs would now correctly send digital post

  1. Modify the element intended for recipient to have the key cpr_number.

New jobs will now refer to the old element id, recipient, rather than cpr_number resulting in failed jobs. Furthermore, if users checks the Digital Post-handler configuration by clicking 'edit' on the handler it will look like it is configured correctly resulting in users just cancelling rather than re-saving the handler.

This is not limited to the Digital Post-handler. The following handlers have the same issue or variations of it:

More may exist

Proposal

An OS2FormsHandler-interface involving a validateConfiguration(...) method alongside a OS2Forms Handlers module that when visiting a webform loops over added handlers invoking the validateConfiguration(...)-method for each of them.

Any configurations that do not validate should then result in some sort of indication explaining which handlers are misconfigured and how.

Validation could include checking

  • Elements existing
  • Paths to files being correct
  • Other references existing

For handlers we do not control we could consider wrapping them with the only change being the addition of the above validation method.

Furthermore, handler configurations that include selects should have an 'empty'-option to indicate that it is not configured.

Footnotes

  1. Involves a reference to a flow by id which is probably unlikely to change. ↩

Activity

  1. added theissue type on Mar 2, 2026
  2. added a commit that references this issue on Jul 13, 2026
  3. jekuaitk commented on Jul 16, 2026

    @jekuaitk
    ContributorAuthor

    As per #340 and more specifically #340 (comment) the approach to this has been revised.

    Insight

    A handler's configuration form already is the definition of valid configuration. buildConfigurationForm() builds its select options from the webform's current elements (filtered to supported types), marks mandatory settings #required and validateConfigurationForm() holds the handler's custom validations.

    Idea

    Programatically run the logic from the handlers without submitting them in a wrapper. The wrapper reuses the handler's build and validate steps but has an empty submitForm(), so validation runs without no actual submit.

  4. gBarlach commented on Oct 12, 2026

    @gBarlach

    @ds-bellcom vil I lave code review af denne?

  5. ds-bellcom commented on Oct 13, 2026

    @ds-bellcom
    Contributor

    @gBarlach vi estimerer at skulle bruge ca. 3,5 timer på at lave review. Giv besked hvis vi skal planlægge det.

  6. gBarlach commented on Oct 13, 2026

    @gBarlach

    @ds-bellcom Det er hermed godkendt at I laver review på 3,5 timer.

  7. ds-bellcom commented on Oct 14, 2026

    @ds-bellcom
    Contributor

    @gBarlach Stan har lavet review i dag og har et par kommentarer til ITK.

  8. gBarlach commented on Oct 15, 2026

    @gBarlach

    @MadNicGit vil I kigge på Bellcoms kommentarer ?

  9. gBarlach commented on Oct 21, 2026

    @gBarlach

    Hermed godkendt til efterårsrelease 2, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions