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

Inconsistent behaviour when conditions are created with no rules #689

Closed
AndyButland opened this issue Dec 20, 2021 · 0 comments
Closed

Comments

@AndyButland
Copy link

AndyButland commented Dec 20, 2021

Created from this comment on a closed issue.

If an editor adds conditions to a field, but omits to add any rules, we have inconsistent behaviour depending on whether the "Any" or "All" logic type is selected.

The current behaviour is:

  • Client-side, the field is shown as if no conditions are applied.
  • Server-side, if "all" is selected as the logic type, the data entered into the field is saved to the entry.
  • Server-side, if "any" is selected as the logic type, the data entered into the field is not saved to the entry.

Obviously an editor shouldn't really be enabling conditions on a form and then not defining any rules, but if they do, semantically it seems we should consider the condition as always not passing. I.e. neither "any" nor "all" of the rules are correct, so the condition should fail.

Hence we should change the behaviour such that:

  • Client-side, the field should be shown or hidden as if the condition has failed.
  • Server-side, whether "all" or "any" is selected as the logic type, the data entered into the field should not be saved to the entry.
    • Of course with the client-side change, the field won't be shown and as such we'll be unlikely to have a value provided.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant