[WC-3417] Fix string empty/not-empty filters#2236
Open
r0b1n wants to merge 1 commit into
Open
Conversation
Because strings can be in two different states, one is `empty`, other is "". Previously, before 11.6, empty() was matching both, now, because "of new string behavior", empty strings have to be matched explicitly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixed an issue where "is empty" and "is not empty" string filters were not working correctly in some cases.
The root cause was that string attributes can be in two different states:
emptyor""(empty string). Previously, theempty()filter matched both states, but due to new string behavior in recent Mendix versions, empty strings must now be matched explicitly.Changes
BaseInputFilterStore.getFilterCondition()to generate compound filter expressions for string attributes:attr = empty OR attr = ""attr != empty AND attr != ""isEmptyStringExp()andisNotEmptyStringExp()to recognize these compound expressionsinputStateFromCond()to restore filter state from compound expressionsTest plan