Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello!
I faced a small problem with Views Field View module. I use Global: view field to insert a view with 5 argements, one of which is configured to allow multiple values, which means that users can enter multiple values in the form of 1+2+3 (for OR) or 1,2,3 (for AND). Therefore I used the following text as Contextual filters: "all,all,[%nid]+[%nid_1],all,all" (). But Views Field View module doesn't return correct view. One interesting moment. When I write "all,all,4731+4732,all,all" instead of the previous text the module returns correct results. It looks like a bug. Please fix it.
Comments
Comment #1
Norberto Ostallo CreditAttribution: Norberto Ostallo commentedThe problem is caused by the way the module replaces token values in function get_token_value in file views_field_view_handler_field_view.inc.
I solved this problem by adding recursion at the beginning of the function, allowing a single view argument containing multiple tokens to be replaced multiple times when tokens are separated by '+'.
Comment #2
milos.kroulik CreditAttribution: milos.kroulik commentedThis doesn't work for me, embedded view is still empty. Any idea how can i debug this?
I can also confirm, that filtering works if filter values are inserted directly into the field instead of using field tokens.
Comment #3
siva.thanush CreditAttribution: siva.thanush commentedWhere the above code must be replaced?
Can you suggest if you have anyother options?
I have two terms exposed in main view.
I need to pass two arguments in the views field views and make it work.
When i passes multiple agruments like [!tid],[!tid_1] (Say tid is 123 and tid1 is 456).
And wheni passed 1,4
the result displayed is
1,4
1,5
1,4
1,6
etc.,
How do i make it like
1,4
1,4
...
...
...
Comment #4
bmango CreditAttribution: bmango commentedI can confirm that the code update in #1 works great! Many thanks!
Comment #5
bmango CreditAttribution: bmango commented