This thread is resolved. Here is a description of the problem and solution.
Problem:
In a many-to-many relationship the client wants to display related posts, sorted by a field on the related posts.
Solution:
The current implementation of many-to-many relationships involves creating an intermediate post type, and then creating a View which returns the intermediate posts with a filter for the parents on one side, while using the id attribute to display content from the parent on the other side.
That View can only filter by fields present on the intermediate post type itself, which means duplicating the field in question from the parent on the intermediate posts.
This will become redundant with the switch to Types 3.0, when it will eventually be possible to filter by fields of related posts.
This support ticket is created 6 years, 11 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.
there is always a problem, the agenda is not complete and only appears for one artist. I do not understand where the problem comes from.
Thanks for your help
Because you use conditional shortcodes in your View I made a small edit to simply output the participant post title and the concert date field of the participant.
You can see that it seems to be working correctly on the pale grey artist page: hidden link
Not all of the concerts appear, but I don't know how you create this page, I cannot see any template, but I'm guessing that where you insert the View for the concerts you have set a limit parameter.
Presumably that is why there is an Agenda Complet button which takes you to another page where you can see all concerts.
I spent a long time trying to understand why some of the concerts weren't showing up and in the end it appears that the code snippet I proposed to run one time to copy the concert fields had not been run, so some of the participant posts had the concert date and others didn't, and so ordering by the concert date field was not including posts with no concert date.
I ran the code and it now appears to be working: hidden link
there is always the same problem, sorting is not done in order of concert date but by date of publication, when I sort by concert date, nothing is displayed or only a few dates.
Thank you for your precious help.
Thank you Nigel, it's beautiful 😉
There is still a small problem, when I want to show only dates later or below today in the query filter, nothing is displayed, I guess it is still missing a little detail?