Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.3
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
28 Apr 2012 at 07:42 UTC
Updated:
21 Mar 2013 at 05:48 UTC
I've got the following code embedded in page.tpl.php:
<?php print views_embed_view('teacher_assignments', 'panel_pane_1', 5); ?>
<hr />
<?php print views_embed_view('teacher_assignments', 'panel_pane_1', 7); ?>
These are the same view, same display. The view-dom-id class on each is different (many threads discussing that as the culprit I've found).
The issue is that if the filter on one is set and applied, the page reloads with the other view's exposed filter set to the same value as well.
To make sure it wasn't a page.tpl.php issue, I tried adding the view to a Page Manager's panel variant, each with a different argument, and the same issue occurred.
(My bad if this isn't a bug and is by design.)
Comments
Comment #1
bsuttis commentedMore info:
Using Firebug's console, there are POST requests fired for each of the exposed filters when changing the first.
'Use AJAX' is Yes. 'Autosubmit' is checked, 'Hide submit button' is checked.
On page load, there are 2 embeds of the same view. On filter option change, POSTs for both exposed filters fire. The second time, only the first one fires. If there are 3 embeds, 3 POSTs are fired, and so on.
All the while, if I go to change the second (or third, fourth, so on) embed's filter, the filter is non-AJAXy (page reloads with query in path).
Running latest Views (7.x-3.3) and latest CTools dev.
Comment #2
dawehnerThis is somehow not really a wonder, because internally simply the form keys are the same, so in the actual url both are used.
One thing you can do is to enable ajax, so they work separate from each other.
Another way i could imagine is to have two displays which use different identifiers in the filter settings, though in general i don't think this is an actual bug.
Comment #3
bsuttis commentedThanks for the clarification.
AJAX is enabled, and when enabled it acts oddly too. The first exposed form triggers all other exposed forms, while the second filter does not fire the AJAX POST at all and instead reloads the page (with the filter's query in the URL).
I suppose another workaround is to use a different view display as well.
Comment #4
bsuttis commentedFollowing up -- to get around this I cloned the same view display multiple times. It works for an arbitrary number of embeds but would get cumbersome to manage if the number of embeds was 10+, for example.
Comment #5
senthil_ttl commentedI have upgraded Views module from "Views 7.x-3.0-alpha1" to "Views 7.x-3.3". After that views_embed_view() not returning values in .tpl.php.
Anyone can help me?