Skip Navigation

[Resolved] Sorting controls not working as expected

This support ticket is created 4 years, 5 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 21 replies, has 2 voices.

Last updated by simonM-5 2 years, 8 months ago.

Assisted by: Christian Cox.

Author
Posts
#1383411

I am trying to:
Implement sorting controls on a custom search filter.

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

I expected to see:
User chooses some search criteria and chooses how the results should be sorted.

Instead, I got:
The results return fine, but are not sorted according to the sorting criteria specified by the search controls.

I followed the following documentation and believe I have done everything correctly, but obviously something is not quite right: https://toolset.com/documentation/user-guides/allowing-visitors-to-sort-the-front-end-results/

I also scanned through the first 5 or 6 resolved threads on the topic "sorting controls not working" but they didn't shed any light unfortunately.

Thanks and regards
Simon

#1383437

I think we're looking at another symptom of the same problem, because if I display both the search filters and search results using the same shortcode the problem seems to be resolved. I'm escalating this issue to 2nd tier as well for confirmation and I'll keep you posted here.

#1385207

Okay it turns out there are a couple of known issues with split filters, and you can follow along in the errata post here for more information: https://toolset.com/errata/front-end-sorting-has-no-effect-if-views-custom-search-and-results-are-displayed-separately-but-on-the-same-page/
Our developers are aware of the issue and working on a fix. I will keep you posted here as I receive more information, but in the meantime it's best not to split a View into separate filter and results shortcodes or separate blocks if you plan to use front-end sorting.

#1385925

Hi Christian

We have just tested this again using one view. Both the sorting and the location work correctly.

This is of course functionally great but aesthetically a bad user experience.

Can you give us any rough indication at all of when this is likely to be fixed based on experience? I appreciate that you can't promise any dates etc but are talking either weeks or months? Is it already in QA in an upcoming plugin update, for example?

Thanks and regards
Simon

#1385939
Screen Shot 2019-11-18 at 8.49.21 AM.png

I can see that the solution is not yet ready for QA and it's not yet scheduled for the next plugin release. Beyond that, I am not able to predict anything because those schedules are not set yet. Based on recent experience, most of our resources are devoted to the Blocks project. With a bit of custom HTML / CSS in the Output editor panel, you can separate the filters and results visually without using separate shortcodes. I recommend this approach in the interim while the bugs are addressed. If you cannot see the Output Editor panel, scroll to the top right corner of the View editor and click "Screen Options". You can activate the panel here.

#1386033

Hi Christian

Thanks for the update, and the very helpful tip about styling in the Output Editor. We can live with this workaround for now. We have made a few adjustments and it works well. So please just keep us informed when the fix is available.

Kind regards
Simon

#1533637

HI Christian

Is this issue also resolved with the latest updates/fixes for split views?

Kind regards
Simon

#1535911

Hello, unfortunately not yet, sorting issues in split Views are still open. I'll keep you posted here as I receive more information.

#2112257

Update - we expect to include the fix for the sorting issues in split Views in the upcoming Views 3.6 / Blocks 1.6 releases. I'll update the ticket here when we begin releasing those updates. I suspect that will happen very soon, as we are nearly finished with our internal release testing.

#2125249

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

#2127589

Hi Christian

Thanks for letting me know, we will perform some testing and let you know if our issue is resolved.

Kind regards
Simon

#2127757

Understood - I will stand by for your updates.

#2127933

Hi Christian

It appears to us that the sorting is not working 100% correctly. I'll try to summarise:

The Last Modified appears to work in both Find a Job Search and Results View and Find a Native Nanny Search and Results View, however our custom fields don't appear to work correctly.

1) In Find a Native Nanny, the user should be able to sort by our custom field Available From Date (nanny-available-from-date). It appears as if Nanny Ads with Available From Dates in the past are not appearing in the search results if "Available From" is used as the sort criteria.

2) In Find a Job, the user should be able to sort by our custom field Start Date (family-start-date). It appears as if Job Ads with Start Dates in the past are not appearing in the search results if "Start Date" is used as the sort criteria.

3) In each of the mentioned Views, in the Elementor Pro Edit Toolset View Widget > Override View basic settings, I have set Order by = modified, and Order = Descending for the View showing the Search results. The suggestions for Order by are "ID, date, author, title, post_type or field-slug"... Can you please confirm that "modified" is a valid argument here (as I'm pretty sure it works when you call the view via a shortcode).

4) On a related previous Toolset ticket (https://toolset.com/forums/topic/sorting-by-last-modified-not-being-respected-on-front-end/), we were given a custom code snippet "func-set-default-orderby-modified". Is this issue resolved with the latest updates, and if so, is this custom code obsolete and can now be deleted?

Thanks and regards
Simon

#2129093

Okay sure, I can check these issues if you provide updated access credentials for the development site. The information in this ticket is old and outdated.

4) On a related previous Toolset ticket...we were given a custom code snippet "func-set-default-orderby-modified". Is this issue resolved with the latest updates, and if so, is this custom code obsolete and can now be deleted?
No, the latest updates did not address the issue you are referring to in another ticket. It is still in our developers' queue but has not yet been resolved.

#2129587
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.