Fix: Apply case-sensitive filter in uniqueness validation#7470
Merged
Conversation
emenslin
approved these changes
Oct 3, 2025
Collaborator
emenslin
left a comment
There was a problem hiding this comment.
- Define a uniqueness rule on a text field (e.g., remarks) in Uniqueness Rules.
- Create a record (e.g., Accession) with a text value, e.g., abc.
- Create another record with the same text in different case, e.g., aBc.
- Verify: the record is created successfully without any uniqueness error.
Looks good, I tried with a few different text fields and I didn't run into any issues.
lexiclevenger
approved these changes
Oct 3, 2025
Collaborator
lexiclevenger
left a comment
There was a problem hiding this comment.
- Define a uniqueness rule on a text field (e.g., remarks) in Uniqueness Rules.
- Create a record (e.g., Accession) with a text value, e.g., abc.
- Create another record with the same text in different case, e.g., aBc.
- Verify: the record is created successfully without any uniqueness error.
- Verify that unique fields (e.g., username) correctly block case-sensitive duplicates on the frontend by showing a validation warning instead of allowing submission and throwing a backend BusinessRuleException.
Looks good! No error occurs when unique fields have the same text with different cases
melton-jason
approved these changes
Oct 7, 2025
Contributor
melton-jason
left a comment
There was a problem hiding this comment.
Nice work! 👏 🚀
Nothing major in my comments, primarily just refactoring/code maintainability suggestions.
CarolineDenis
approved these changes
Oct 8, 2025
Triggered by 5986a45 on branch refs/heads/issue-4058-1
…to issue-4058-1
acwhite211
approved these changes
Oct 15, 2025
13 tasks
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.
Fixes #4058
This PR addresses the case sensitivity discrepancy between frontend and backend uniqueness rules. Previously, the frontend enforced case-sensitive uniqueness, but the backend validation raised exceptions due to case-insensitive checks. The implementation has been updated so that backend uniqueness validation now uses case-sensitive matching (BINARY comparison) on string fields, while preserving the original behavior for related lookups and non-string fields. This brings the backend into alignment with the frontend, ensuring consistent validation across the application.
Checklist
self-explanatory (or properly documented)
Testing instructions