Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[civiremote_entity] Rebuild form in case of error #36

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

dontub
Copy link
Contributor

@dontub dontub commented Sep 20, 2024

Previously on error a redirect to the destination (URL parameter) was executed, if given. Otherwise, a redirect to the form page was executed. Now in both cases the form is rebuild (so the entered values are kept).

Copy link
Collaborator

@jensschuppe jensschuppe left a comment

Choose a reason for hiding this comment

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

Will the destination parameter be lost entirely or just "postponed" to the next submit?

Wondering whether we should instead rebuild the form (as failed validation does) - this would avoid a redirect to the destination as well and keep the form instance alive (see Drupal Form API Workflow).

@dontub dontub changed the title [civiremote_entity] Stay on form page in case of error [civiremote_entity] Rebuild form in case of error Sep 24, 2024
@dontub
Copy link
Contributor Author

dontub commented Sep 24, 2024

You're right, rebuilding is the better approach here so I changed that.

Previously on error a redirect to the destination (URL parameter) was
executed, if given. Otherwise, a redirect to the form page was executed.
Now in both cases the form is rebuild (so the entered values are kept).
@dontub dontub added enhancement New feature or request status:fixed The issue has been resolved (usually by committing/merging code) labels Sep 24, 2024
@dontub dontub added this to the 1.1.x milestone Sep 24, 2024
@dontub dontub merged commit a28b6b7 into 1.1.x Sep 24, 2024
17 checks passed
@dontub dontub deleted the stay-on-form-page-on-error branch September 24, 2024 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request status:fixed The issue has been resolved (usually by committing/merging code)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants