Problem/Motivation

views_infinite_scroll_preprocess_views_view() overwrites any existing #theme_wrappers and attributes (including default views classes), causing incompatibility with other modules, complicating theming, etc.

Scenario 1: Using the "Views Bulk Operations" module

Steps for reproducing:

  1. Enable the "Views Bulk Operations" module
  2. Add and configure a bulk operations field
  3. Confirm that bulk operations can be applied to selected view rows/results
  4. Configure the view to use an Infinite Scroll pager
  5. Attempt to apply bulk operations to selected view rows/results

Expected result:
Bulk operations are applied as before.

Actual result:
No action occurs.

Scenario 2: Using the "Blazy Grid" view format

Steps for reproducing:

  1. Create a view with format "Blazy Grid"
  2. Check grid structure; note that grid has classes like "blazy blazy--grid block-column block-count-8 blazy--on"
  3. Configure the view to use an Infinite Scroll pager
  4. Check grid structure

Expected result:
Grid has classes like "blazy blazy--grid block-column block-count-8 blazy--on"

Actual result:
Grid has only these classes: "views-infinite-scroll-content-wrapper clearfix'"

Proposed resolution

Update views_infinite_scroll_preprocess_views_view() so it applies the necessary container and attributes in a non-destructive way.

Remaining tasks

Review/test the patches below.

User interface changes

None.

API changes

None.

Data model changes

None.

Comments

Shefarik created an issue. See original summary.

sershevchyk’s picture

Issue summary: View changes
StatusFileSize
new1.1 KB
sershevchyk’s picture

Need review

sershevchyk’s picture

Issue summary: View changes
sershevchyk’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: 2945524-infinite-scroll-default-classes.patch, failed testing. View results

sershevchyk’s picture

sershevchyk’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 7: 2945524-infinite-scroll-default-classes-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

sershevchyk’s picture

sershevchyk’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 10: 2945524-infinite-scroll-default-classes-3.patch, failed testing. View results

sershevchyk’s picture

sershevchyk’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 13: 2945524-infinite-scroll-default-classes-4.patch, failed testing. View results

sershevchyk’s picture

sershevchyk’s picture

Status: Needs work » Needs review
sershevchyk’s picture

Status: Needs review » Reviewed & tested by the community
sershevchyk’s picture

Status: Reviewed & tested by the community » Patch (to be ported)
ndewhurst’s picture

I encountered a similar issue. For me, the symptom was that Views Bulk Operations would cease to work after enabling Views Infinite Scroll for a particular view. The problem was that views_infinite_scroll_preprocess_views_view() is overwriting any existing theme wrappers and associated classes (which, in the case of VBO, meant that the form element was never created).
Views Infinite Scroll can add its own wrapper and classes without killing those that have been added by other modules/themes/etc.
I've attached a patch that does this, and I've found this approach to work well on my site, with both modules working together flawlessly.

ndewhurst’s picture

Assigned: sershevchyk » ndewhurst
Status: Patch (to be ported) » Needs review

P.S. I also created an interdiff against the patch in #16 for comparison (see above). Will also update the issue summary to be a bit broader.
@Shefarik, hopefully this looks good to you as well!

ndewhurst’s picture

Title: Infinite Scroll rewrite default views content classes » Infinite Scroll overwrites default views content classes and existing theme wrappers
Issue summary: View changes

I updated the issue title and summary to clarify that it has multiple symptoms, outline those symptoms in a consistent format, etc.

ndewhurst’s picture

Assigned: ndewhurst » Unassigned
ndewhurst’s picture

Priority: Minor » Normal
anybody’s picture

There is also a problem with blazy based on this bug: #2927412: Blazy Grid Views Formatter: incompatible with views_infinite_scroll

#20 is better than #16 because of the used array structure. RTBC+1. Will a module maintainer have a look?

ndewhurst’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1.07 KB

Patch re-rolled against latest dev version.

ndewhurst’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.03 KB

Patch for version 8.x-1.5

Status: Needs review » Needs work
ndewhurst’s picture

Status: Needs work » Reviewed & tested by the community

Note: The patch in #27 is for convenience in case anyone wants to apply it to 8.x-1.5. It doesn't apply to the current dev version.
Marking RTBC per #25

  • ndewhurst authored cc0bb08 on 8.x-1.x
    Issue #2945524 by Shefarik, ndewhurst: Infinite Scroll overwrites...
honza pobořil’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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