I've created a panels mini panel with 2 of the same views panes, but with different arguments.
The pager element gets set to 1 for the first view, and 2 for the second view.

ajax_view.js somehow gives both views the same set of settings, resulting in both views using pager element 1.
Below is the offending code:

      var view = '.view-dom-id-' + settings.view_dom_id;
      if (!$(view).size()) {
        // 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;
      }

Removing the Backward compatibility part (the whole if statement) fixes the issue.

The issue may lie a little deeper, though, since the Drupal.settings.views.ajaxViews shows that there are 4 views (while there are only 2). It assumes view-dom-id-3, view-dom-id-4, view-dom-id-5, view-dom-id-6 exist in the HTML, but in reality only view-dom-id-4, and view-dom-id-6 exist.

Thus, when trying to find view-dom-id-3 and view-dom-id-5 it can't find them and tries to use the backwards compatility code instead.

CommentFileSizeAuthor
#3 multiple-views-pager.patch1.33 KBvaish

Comments

merlinofchaos’s picture

Wow, this issue is old. Do you know if this still happens? I suspect we've got an issue here with multiple instances of the same view?

moonray’s picture

Version: 6.x-2.5 » 6.x-2.10

Still getting this issue in the views 6.x-2.10.
(this is a completely different site)

vaish’s picture

Version: 6.x-2.10 » 6.x-2.x-dev
Status: Active » Needs review
StatusFileSize
new1.33 KB

Attached patch fixes this issue by checking if settings.view_dom_id is defined before trying to use it. This prevents triggering of backward compatibility code when it's not necessary that was messing up DOM and pager IDs.

How to reproduce the issue:

1. Create two views, each with multiple displays (I was using views with 4 and 6 displays respectively).
2. Create two quicktabs (requires quicktab module), one for each view. Each tab representing one views display.
3. Configure quicktabs to load only first tab on page view.

merlinofchaos’s picture

Priority: Critical » Major
Status: Needs review » Fixed

Committed to 6.x-2.x and 3.x

This really shouldn't have been marked critical, though.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.