-
Notifications
You must be signed in to change notification settings - Fork 26
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
Fix validation issue with (dynamically) optional field #4114
Conversation
The component changes properties dynamically, and the logic evaluation seems to be missing some components.
... because of Formio configuration not being updated correctly while the entire submission logic is being evaluated.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4114 +/- ##
=======================================
Coverage 96.10% 96.10%
=======================================
Files 730 730
Lines 23090 23090
Branches 2698 2698
=======================================
Hits 22190 22190
Misses 638 638
Partials 262 262 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if I understand correctly this was a bug before backend validation, but only appears now with this validation?
mutation_operations: list[ActionOperation] = [] | ||
for operation in iter_evaluate_rules(rules, data_container, submission): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably this can be built using a list comprehension now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a list comprehension makes the code look pure, but it isn't, data mutations are applied as the logic rules are evaluated by looping through them.
No, because the logic evaluation for the entire submission runs after all form steps have been submitted. It was deliberate to skip the property actions, since they affect the UI/client side validation, but that was not presented anymore because the user is on the "confirmation" screen. |
... because of Formio configuration not being updated correctly while the entire submission logic is being evaluated. Backport-of: #4114
Backported to stable/2.6.x in b0dc21d |
Taiga DH 671
If the test suite passes first try I'm eating my shoe.Needs backport to stable/2.6.x