Closed mikesealey closed 1 month ago
After reading this I had an inclination that this probably affects all operators rather than just "is in" and it looks like that's correct. The reason for this is due to the "on empty filter" operator which is designed to return all rows when all filters are empty. We use this same code behind the scenes to evaluate conditions, but this behaviour means that when your condition value is "empty" it effectively skips it and returns true.
So this same thing happens if you just do "equals" with an empty value too.
The fix is to ensure that we use "none" for the "on empty filter" parameter of our query when evaluating conditions in the client library. This is an easy fix 👌
Threw up a quick fix!
Checklist
Hosting SELF & CLOUD
Describe the bug Following a discussion https://github.com/Budibase/budibase/discussions/14604 - the "Update Setting" condition 'Is In" erroneously returns true when compared to an empty string, or a
null
valueTo Reproduce Steps to reproduce the behavior:
Update Setting Text to TRUE IF {{ New Form.Fields.this_value }} is in binding {{ New Form.Fields.that_value }}
The following values should return false, but instead return true - null, "", []
Expected behavior Empty strings, empty text field, empty array, and
null
should all return "false"Screenshots See app-export below
Screencapture https://jam.dev/c/ab9f539d-3b78-40f9-a566-d0c43b5e416d
App Export 14604-export-1726728104323.tar.gz
Desktop (please complete the following information):
Additional context Related: https://github.com/Budibase/budibase/discussions/14604