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
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
Hi! It was no defined order post. I added as you wrote orderby="title", but nothing changed.
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.
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?
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.
Just wanted to let you know that I'm still working on this and will share the results, within the next few hours.
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.
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.
My issue is resolved now. Thank you!