Hello Vimal, Beda here.
I was assigned to this task, and I need to interact with you to clarify a few things that remain unclear.
Only if we know how, and why things happen, we can as well provide proper and safe fixes for the issues.
I apologise if this pushes back the ticket by a day or two, but I cannot see what we are supposed to do, and how this is supposed to be a use case, where a BUG becomes visible.
Please let me explain and mention what details I need from you to clarify the issue.
1. I understand you use the Beta Versions of our Plugins (Views updated today again). You have a Many To Many relationships between 2 post types. It is an infinite to infinite Relationship, has no Custom Fields on the Intermediary post Type and that post type is not shown in the admin.
You created a few posts in each type and connected them as per your needs.
Is this correct?
2. Then, I understand you have a View for each Post Type and in each View, you query just one of each Post Types.
This leaves you with a "Parent" and a "Child" View.
In the "Child" View you added a Query Filter that says:
Select posts in Any relationship, that are related to the Post with ID set by the shortcode attribute wpvprchildof.
eg. [wpv-view name="view-name" wpvprchildof="123"]
The loop of this View may output for example the Post Titles.
Is this correct?
3. The "Child" View is now inserted in the Parent View's Loop.
In the ShortCode attribute you pass the ShortCode for the Post ID, so to fetch the ID of the "Parent" post looped in the "Parent View".
This is wrong. You should do that with the Query Filter Setting "Select posts in Any relationship, that are a related to the current post in the loop.", but it will not break anything if you do it the way you chose either.
It is just not the suggested approach for this sort of nesting.
Is this so far correct as well?
If all this is correct, then I cannot replicate any issue because I see all outputs properly and as expected.
But reading on in your ticket, https://toolset.com/forums/topic/wpv_filter_query-not-working-with-nested-view/#post-630460, you mention a 3rd View.
Please, can you explain how many Views you have nested and how?
As well I need to know their Query settings, and more, basically I need to replicate this structure exactly.
I fail to understand where the 3rd View comes from.
After, reading on with the code you provide, Nigel already explains that this code is not correct:
https://toolset.com/forums/topic/wpv_filter_query-not-working-with-nested-view/#post-630060
That code should alter a Query, not echo things.
Can you help me to replicate the issue you are facing, I just need to know what exactly you want to achieve, and how you try to achieve this.
If you want you to spare time I can suggest to provide me with a copy of the site, and the links to where I can see and edit the Views.
This will help me greatly.
Thank you very much for the collaboration.