Using ajax, we are loading a view onto a page which already has views on it. The view we loaded dynamically doesn't know about the other already generated view on the page, and there are now two views that have generated with exactly the same dom-id: eg I have two views with the class: ".view-dom-id-1".
When submitting via exposed filters, views assigns targets for receiving the filter result using the .view-dom-id number, and subsequently when it gets the results back from the server, it will replace every view with dom id same as the calling view... The view selector it uses to identify the views needs more specificity.
Temporary fix is to force it into 'backwards compatible' mode by commenting out an if statement on line ~49 in js/ajax_view.js
if (settings.view_dom_id) {
var view = '.view-dom-id-' + settings.view_dom_id;
//if (!$(view).size()) { // Commenting this conditional out fixes the duplication issue
// Backward compatibility: if 'views-view.tpl.php' is old and doesn't
// contain the 'view-dom-id-#' class, we fall back to the old way of
// locating the view:
view = '.view-id-' + settings.view_name + '.view-display-id-' + settings.view_display_id;
//}
}
Someone with more views knowhow may understand the implications and what a possible long term solution would be.
Thanks guys, let me know if you need any more information.
So, anyway, someone who knows more about why this
Comments
Comment #1
drupalninja99 commentedI also have this issue for 6.x-2.9, I used this patch to fix it - need a long term solution though.
Comment #2
dawehnerThis seems to be a duplicate of #655002: 2 separate ajax views on a page => results updated in both places.
Please test the patch in the other issue.
Comment #3
secoif commentedAlso a duplicate of http://drupal.org/node/1113512