Repository navigation
[3.0] Finds members on PostgreSQL whatever case the search is typed in - #9716
Merged
jdarwood007 merged 1 commit intoOct 4, 2026
Merged
jdarwood007 merged 1 commit into
jdarwood007 merged 1 commit into
Conversation
On a case sensitive database Memberlist::search() folds the columns it
searches to lower case, but compared them with the search as typed, so
a search with any capital letter in it matched nobody. The search is
now folded to match through {string_ci:}. The email search already was.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
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.
Description
On PostgreSQL, searching the member list finds nobody as soon as the search has a capital letter in it. Searching for
Admindoes not findadmin, and neither doesADMIN.Memberlist::search()folds the columns it searches to lower case when the database is case sensitive:and then compared each of them with
{string:search}, the search exactly as typed. Only the email search was folded, when it was built. MySQL compares without regard to case anyway, so nothing looked wrong there.The search is now compared through
{string_ci:search}, the type that exists for exactly this: on PostgreSQL it wraps the value inLOWER()to match a folded column, and on MySQL it is an ordinary string. The email search keeps{string:email_search}, since that one is folded already.Test
MemberlistSearchTestsigns in as the administrator and searches the member list for their own name in capitals and capitalised, and expects a link to their profile in the results rather than in the menu. Without the change, on PostgreSQL:With it, both pass on MySQL and PostgreSQL.
Overlap with #9597
#9597 (case insensitive comparisons, part 2 of 2) also changes this query, to
LIKE {string_ci:search}. It was written against the code before the email search changes (70a2a7d, 7ee5156), which rebuilt theWHEREper field, and it no longer applies there. This is the same fix on the current code, on its own so that it can land without waiting for the rest of #9597; that one drops its hunk for this file when it is rebased.Found while building the template snapshot tests in #9712, where the member list snapshot searched for "Snapshot" and came back empty on PostgreSQL only.
Issues References (Fixes|Related|Closes)
Related: #9712, #9597
🤖 Generated with Claude Code