Search only sorts by first name #1103
EXPLANATION OF THE ISSUE
Search only sorts by first name
STEPS TO REPRODUCE THE ISSUE
Visit this page. This is a brand new, clean install with no additional plugins. You'll see a list of therapists ordered by last name. Enter a state in the search field. The list is now sorted by first name and not last name as expected.
BEHAVIOR THAT I EXPECTED
The shortcode is [s2Member-List enable_list_search="yes" orderby="last_name" order="ASC" show_fields="state_province, ID"/]. I would expect that a search would return the results ordered by last name because because orderby="last_name" is in the shortcode.
I did import the S2member configuration and users from the live website so I suppose it's possible the problem moved with that.
BEHAVIOR THAT I OBSERVED
The text was updated successfully, but these errors were encountered:
Thank you for taking a look at this. I don't know how to use Github, so pardon me if I should have provided this info in a different way.
Here's the template member-list.php.zip for https://sstarnet.org/find-a-researcher/ . I really don't think it's that because the following clean installations use the default template and you'll see the same results.
I'll email the login credentials for these tests again. They all use the same credentials.
NOTE: To try to rule out a hosting issue, the above clean installations are hosted at Siteground. The original website, sstarnet.org, is hosted at GoDaddy.
Also, https://sstarnet.org/find-a-researcher/?s2-s=Home sorts by first name when searched. I haven't changed any parameters at all so I don't know what you saw the first time.
Please let me know if there's anything I can do to help.
Thanks again for helping with this issue.
Was unable to reproduce original issue on clean installation.
WordPress Version: 4.8-RC2-40880 / WordPress 4.7
Tested the exact same shortcode you had used:
[s2Member-List enable_list_search="yes" orderby="last_name" order="ASC" show_fields="state_province, ID"/]
with the addition of adding of using
Front End test for [s2Member-List /]:
As you can see, the names are listed in
Those also show a listed ascending order by last name. If you mean that they don't show the
The display name is
Please refer to this line of code here
Thanks again for your help with this issue.
However, I don't see a search field in your screen shots. The problem does not occur when the page first loads. The problem occurs only when the page is searched from the search box. Your code above does not include the shortcode [s2Member-List-Search-Box placeholder="Search"/] for a search box.
As I have mentioned, everything is fine with simply loading the page, as your test affirms. The problem only occurs when a search is executed.
I've included a search box and was unable to replicate your original error consistently based only off of Display Names / First / Last:
Click for Search Results Page
The names would always be alphabetical order in first couple of tests:
However, I continued to experiment to try and replicate your original error. I was able to replicate it more consistently when I included usernames that were not based off of their names.
Click for Search Results Page
Search results ordered by Username:
The Usernames are sorted in Alphabetical order despite having set it to sort by Last Name, (
On your search page https://river-graphics-design.net/sstar/?s2-s, the results look like they are being sorted by First name, but that could be the result of the Username being based off of their First and Last name.
Thanks for continuing to explore this issue. Can you please respond to/confirm the following so I can relay this info to my client?
I've also been able to reproduce this issue, although I'm not 100% sure that it's a bug and not just unnecessarily confusing.
Steps to Reproduce the Issue
I'm not sure if this is because the
@jaswrks we could use some clarification from you here when you get a chance.
Nice find. Yep, that's a confirmed bug. Thank you for reporting this.
And this line, where we need to merge the dummy meta keys so that