Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294437

Drupal.views.ajaxView is not initializing pagers in nested views

$
0
0

Problem/Motivation

Drupal.views.ajaxView is not initializing pagers in nested views. The part here:

// Add the ajax to pagers.
this.$view
  // Don't attach to nested views. Doing so would attach multiple behaviors
  // to a given element.
  .filter($.proxy(this.filterNestedViews, this))
  .once('ajax-pager').each($.proxy(this.attachPagerAjax, this));

checks if view is inside another view. As a result pager links in embedded views are initialized in the context of parent. This makes it impossible to perform ajax operations in context of the child view (see this Views Infinite Scroll issue).

Proposed resolution

Initialize ajax views in order determined by their nesting level. The innermost view should go first and mark its elements with .once so they aren't processed again when parent view is initialized.

Remaining tasks

  1. Write patch
  2. Review
  3. Write tests

User interface changes

None

API changes

None

Data model changes

None


Viewing all articles
Browse latest Browse all 294437


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>