My view has an attachment. The main part of the view (not the attachment) has a pager. The pager triggers VIF, which replaces the entire view with the new entire view, including attachment nodes.

Problem:

All the find('.view-content') find ALL the .view-content nodes, including those within attachments. It should find only the main view's content.

Solution:

Use children('.view-content') instead of find('.view-content').

This takes only the view's main content from the ajax response, and adds it to only the current view's main content.

Patch to follow.

Comments

rudiedirkx created an issue. See original summary.

rudiedirkx’s picture

Status: Active » Needs review
StatusFileSize
new1.06 KB

Patch. Created from 2.0, but should apply to current 2.x (23f4efb).

Anonymous’s picture

Bumped into the same attachment issue:
Patched #2 to current 7.x-2.1
Works perfect thanks!

wouter waeytens’s picture

I have the same problem on the D8 version. Is there any patch available for this issue?

bernman’s picture

Version: 7.x-2.0 » 7.x-2.1
Status: Needs review » Reviewed & tested by the community

This patch solved the problem stated for me perfectly. I'm marking this as RTBC against 7.x-2.1.

zenimagine’s picture

Same problem for Drupal 8.5

zenimagine’s picture

#2 Could not apply patch

  - Installing drupal/views_infinite_scroll (dev-1.x f1dbe1f): Cloning f1dbe1f38b from cache
  - Applying patches for drupal/views_infinite_scroll
    https://www.drupal.org/files/issues/views_infinite_scroll-2850339-2.patch (Broken ajax replacement for views with attachments)
   Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/views_infinite_scroll-2850339-2.patch
yazzbe’s picture

Applied patch #2 manually against 7.x-2.1 and worked perfectly.

izmeez’s picture

Status: Reviewed & tested by the community » Needs work
Related issues: +#2736419: Views infinite scroll doesn't work with nested views

I am changing this to needs work because it is related to #2736419: Views infinite scroll doesn't work with nested views and obliterates changes from that issue that were committed to 2.x-dev

izmeez’s picture

Status: Needs work » Reviewed & tested by the community

I am changing the status back to RTBC as it was because there is reference to this also being a 8.x issue, even though it will need to be re-rolled against the latest 2.x-dev and take into account the findings in #2736419: Views infinite scroll doesn't work with nested views

izmeez’s picture

Status: Reviewed & tested by the community » Needs work

Sorry for flip flop but this patch will still need work to apply against 2.x-dev

anybody’s picture

Status: Needs work » Closed (outdated)

Drupal 7 is EOL.