Skip Navigation

[Resolved] Search sorting not working at all

This support ticket is created 5 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 12 replies, has 3 voices.

Last updated by Christian Cox 3 years, 4 months ago.

Assisted by: Christian Cox.

Author
Posts
#1223327

I am trying to: do search sorting in but its not working.
I am trying to sort by field price and field date_start

Link to a page where the issue can be seen: hidden link

I expected to see: the sorting workes

Instead, I got: same results.

Last time you treid to help my you destroy my search please dont do that again

#1223361

Please link me to the thread where our Support unallowedly manipulated and destroyed the search, as we need to investigate this and set up consequences - it is not allowed to us to break 3rd party (your) websites, and/or to make edits, without prior clear allowance from your end.

I tried to change desc/asc on the search form and I see that the posts stay in the same order.
But I do not know what it orders, and if those values maybe are specific numbers/dates, then ordering may not work as it needs to order by a number in that case and this needs to be specified.
The same is valid for searches.
But I also see that it simply resets back to the default, it never applies the asc/desc changes I make.

It might be that you experience this BUG:
https://toolset.com/errata/using-special-characters-in-meta_keys-custom-field-names-break-views-queries/
Since you use special characters (not Latin) in the values, this might be the cause of the issue you see, but does not have to be.

There where many BUGs related to sortorder but those are all solved.
https://toolset.com/known-issues/?wpv_post_search=sort&wpv-pr-child-of-download%5B%5D=308&wpv_aux_current_post_id=399043&wpv_view_count=401205-TCPID399043
https://toolset.com/known-issues/?wpv_post_search=order&wpv-pr-child-of-download%5B%5D=308&wpv_aux_current_post_id=399043&wpv_view_count=401205-TCPID399043

It might also be that this works once you remove certain Plugins or change Theme.
Another approach to find the issue is to create a minimal View where you input/output just the minimally needed data, then try again.
If this works, it means the View has either some setting or queries some data that is the culprit.

To look at this close I'll need backend access, but if this is a live site and I am not allowed to break it, I can only look at it which maximally can help to eventually spot an obvious issue - which may be difficult.
Hence, either a Duplicate of the site, or access to a test site which can break would be required in this case.

Thank you!

#1223900

there is not a problem with the special charactars because i am trying to do order by date and its wordpress built in.

"I tried to change desc/asc on the search form and I see that the posts stay in the same order.
But I do not know what it orders" - if it works its should change the order in one of the choices dec/asc anyway.

my custom fields are in english

#1224175

Hi, please try these troubleshooting steps first:
- Update WordPress, Types and Views to use the latest versions.
- Temporarily deactivate all plugins except Types and Views. Activate a default theme like Twenty Nineteen. Place this View on a custom Page and test again.
- If the problem is resolved, reactivate your theme and other plugins one by one until the problem returns.
- If the problem was not resolved, please tell me exactly how the View and Filters are added to your site. If you used shortcodes, please copy + paste the shortcodes here and tell me where you inserted those shortcodes.

#1225120

I want to give you the login information to check it.

#1225134

I will be glad to do these things for you if you provide login credentials in the private reply fields here.
- Update WordPress, Types and Views to use the latest versions.
- Temporarily deactivate all plugins except Types and Views. Activate a default theme like Twenty Nineteen. Place this View on a custom Page and test again.

#1225219

Okay I logged in and updated your plugins and WordPress. Then I deactivated all plugins except Types and Views. Then I created this test page and inserted the same View: http://www.cruise.shooker.biz/ts-test-view-sorting
Sorting seems to be working here, so there must be something else going on. I will continue to investigate. It's probably a conflict between Toolset and some other plugin.

#1225285

Okay I'm able to reproduce the problem now consistently. Apparently the problem occurs when a custom search View is split up into separate blocks for the filters and results. If I use one block for both filters and results, the sorting options seem to work as expected. I'm asking my 2nd tier team to investigate this in more detail. I'll let you know what I find out. In the meantime, it appears the best workaround is to use one block to display both the filters and results. If you'd like to place the results and filters side-by-side, you can add custom HTML and CSS in the View's output editor.

#1226806

Our team has produced an erratum post about this issue: https://toolset.com/errata/front-end-sorting-has-no-effect-if-views-custom-search-and-results-are-displayed-separately-but-on-the-same-page/

Another workaround: use AJAX to update the results without reloading the page. I'll keep you updated on the progress of the resolution for this issue.

#1227017

So what I need to do now ?

#1227382

You can implement one of the two workarounds immediately, or you can wait for the developers to produce a more permanent solution to the problem. The two workaround options are:
1. Use one Elementor View module to display both the search filters and the results. Do not use separate modules.
2. Use AJAX updates in this View. You can enable AJAX in the Custom Search Settings panel of the View editor screen. If you cannot see the Custom Search Settings panel you can enable it in the Screen Options tab (top right corner of admin page).

#2112379

Update - the front-end sorting issue for split Views should be resolved in the upcoming Views 3.6 / Blocks 1.6 releases. I'll let you know when those are ready to download. I suspect it will be very soon, as we are nearly finished our internal testing procedures for the release.

#2125251

The fix for this issue has been included in the latest round of plugin releases, now available for download or automatic update.