Skip Navigation

[Resolved] DropDown filter not sorted for translated content

This support ticket is created 3 years, 1 month 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 10 replies, has 2 voices.

Last updated by kirillS-3 3 years ago.

Assisted by: Waqar.

Author
Posts
#2225491
DropDownSorting.png

I am trying to: filter view by dropdown custom field

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

I expected to see: DropDown filter sorted asc by translated name

Instead, I got: "randomly" sorted filter

This is not good as it really difficult to find right filter option and confuse visitors

#2226625

Hi,

Thank you for contacting us and I'd be happy to assist.

From looking into the options, it seems that they are being ordered by the post IDs.

Can you please look into the view's "Search and Pagination" section and make sure that the "wpv-control-post-ancestor" shortcode is set to orderby="title"?

For example:


[wpv-control-post-ancestor type="select" default_label="-select-" orderby="title" ancestor_type="user-profile@user-profile-plugin-wp.parent"]

regards,
Waqar

#2226707

Hi! It was no defined order post. I added as you wrote orderby="title", but nothing changed.

#2227385

Thanks for the update and it is strange that it didn't work.

It is possible that some code in a third-party plugin or active theme is affecting this order. Can you please test this again, with all extra plugins disabled (i.e. keeping only Toolset and WPML plugins active) and with a default theme like Twenty Twenty-One?

If the issue persists, please share temporary admin login details, in reply to this message for further investigation.

Note: Your next reply will be private and it is recommended to make a complete backup copy, before sharing the access details.

#2230557

Thank you for sharing the admin access and the shortcode for the relationship filter seems to be added correctly.

Do I have your permission to download a clone/snapshot of the website, to investigate this on a different server?

#2230593

Yes, this will be ok.

#2232283

Thank you for the permission and I've downloaded the website's clone/snapshot.

I'll be performing some tests and will share my findings, as soon as this testing completes.

Thank you for your patience.

#2233053

Just wanted to let you know that I'm still working on this and will share the results, within the next few hours.

#2233363

Thank you for waiting.

During troubleshooting, I was able to reproduce this issue on my test website too.

It turns out, that if WPML is activated and for the post type in the relationship field, option “Translatable – use translation if available or fallback to default language” is set in the WPML post type translation settings, posts are always shown ordered by post IDs, in descending order, regardless of what is set in the relationship filter’s own settings.
( if you'll go to ‘WP Admin -> WPML -> Settings -> Multilingual Content Setup -> Post Types Translation’ and change the cities post type to the "Translatable - only show translated items" option, you'll see that the search field list will be ordered by post titles )

I've shared these findings with the concerned team for further review and will keep you updated through this ticket.

#2234879

Thank you for waiting and I've received an update.

Although, it won't be possible for us to share the time estimate for a new release, there is a quick fix that you can use, meanwhile:

1. Please download this zip patch file and extract it on your computer:
https://toolset.com/patches/post_ancestor.php.zip

2. From the folder wp-content/plugins/wp-views/application/models/shortcode/control/ replace the file named "post_ancestor.php" with the one available in the zip file.

3. After that, visit the view's management page at WP Admin -> Toolset -> Views and use the clear cache button next to the view "HighSchoolSearchViewPolo" ( ID: 1511984 )

Important note: If this fix is not included in the next Blocks/Views release and you see the order issue again after updating these Toolset plugins, you'll need to repeat all these steps again.

#2235991

My issue is resolved now. Thank you!