-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Bug: s2Member-List Search #765
Comments
Next Actions
|
Short-Term PatchFor the benefit of others, and NOT a part of the outline for this issue.
This is a quick hack that I used while running through the instructions above. It will fix you up for now. |
I wrote previously...
That is incorrect. This is not a separate bug. It's the intended behavior. The KBA says |
s2Member-List Search; see wpsharks/s2member#765
Next Release Changelog:
|
Work from this issue was released in s2Member & s2Member Pro v151210. Future comments on this issue will now be blocked. If you have any trouble please open a new issue and report it. A big thanks to all of our great supporters. Happy Holidays :-) ❄️ |
Overview
Reported and reproduced by @patdumond in this private ticket.
Steps to Reproduce
Create 5 users with s2Member Custom Field
state
and set the value toTX
(Texas).Use the following shortcode to search for members.
Expected Result
5 results matching Custom Field
state
to the value ofTX
.Observed Behavior
In
WP_DEBUG
mode, an SQL error occurs. Resulting in0
results.A Few Problems
Our regex pattern match looks for this:
This should include
;
as a possible prefix also; i.e.,(^|\{|;)
We need to filter
s2member_custom_field_
prefixes from this array, now that two searches take place in order to break things down properly. This was a recent change to address another bug, and has resulted in a new bug that now impacts searches looking for Custom Field values.These two lines should only be run if the search query scans columns that are not s2Member Custom Fields. Otherwise the
WP_User_Query{}
call fails.The fuzzy search that takes place (i.e.,"[^"]*TX[^"]*"
) in this particular scenario goes against what we documented in this KBA when it comes to searches that are less than 3 characters. This is a separate bug, but it impacts searches against s2Member Custom Fields also. We should update this to provide better consistency and clarity whenever a site owner is operating with the instructions we have given. See: https://s2member.com/kb-article/s2member-list-shortcode-documentation/#toc-64ab22e4In short, it should be:(^|\{|;)s\:[0-9]+\:"(state)";s\:[0-9]+\:"TX"
, sinceTX
is only two chars.The text was updated successfully, but these errors were encountered: