Skip to content

Cleanup form error handling - #557

Merged
nilmerg merged 1 commit into
mainfrom
cleanup-form-error-handling
Sep 11, 2026
Merged

nilmerg merged 1 commit into
mainfrom
cleanup-form-error-handling

Conversation

@nilmerg

@nilmerg nilmerg commented Sep 10, 2026

Copy link
Copy Markdown
Member

Forms rely mostly on event handling right now but that has a limitation regarding errors in the framework at the moment. The previous work-around now lead to the problem that exceptions upon submit were not rendered as form errors but silently ignored and the form just didn't submit at all without any explanation. The new way to solve the originating problem is to always render form errors but still override onError in forms as there is a case in which it is called but no error event is emitted: In case element validation fails. It is now possible to only rely on Form::ON_ERROR to ensure the client's DOM is updated to reflect the state of the form properly.

requires Icinga/ipl-web#408

Forms rely mostly on event handling right now but that has a
limitation regarding errors in the framework at the moment.
The previous work-around now lead to the problem that exceptions
upon submit were not rendered as form errors but silently
ignored and the form just didn't submit at all without any
explanation. The new way to solve the originating problem is
to always render form errors but still override `onError` in
forms as there is a case in which it is called but no error
event is emitted: In case element validation fails. It is now
possible to only rely on `Form::ON_ERROR` to ensure the client's
DOM is updated to reflect the state of the form properly.
@nilmerg nilmerg self-assigned this Sep 10, 2026
@cla-bot cla-bot Bot added the cla/signed CLA is signed by all contributors of a PR label Sep 10, 2026
@nilmerg

nilmerg commented Sep 10, 2026

Copy link
Copy Markdown
Member Author

@Jan-Schuppik You can test this easily by checking out Icinga/ipl-orm#171 and trying to create a contact group.

@Jan-Schuppik Jan-Schuppik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and works as expected

Image

@nilmerg
nilmerg merged commit e115feb into main Sep 11, 2026
13 checks passed
@nilmerg
nilmerg deleted the cleanup-form-error-handling branch September 11, 2026 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla/signed CLA is signed by all contributors of a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants