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:
- Enable the "Views Bulk Operations" module
- Add and configure a bulk operations field
- Confirm that bulk operations can be applied to selected view rows/results
- Configure the view to use an Infinite Scroll pager
- 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:
- Create a view with format "Blazy Grid"
- Check grid structure; note that grid has classes like "blazy blazy--grid block-column block-count-8 blazy--on"
- Configure the view to use an Infinite Scroll pager
- 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
Comment #2
sershevchykComment #3
sershevchykNeed review
Comment #4
sershevchykComment #5
sershevchykComment #7
sershevchykComment #8
sershevchykComment #10
sershevchykComment #11
sershevchykComment #13
sershevchykComment #14
sershevchykComment #16
sershevchykComment #17
sershevchykComment #18
sershevchykComment #19
sershevchykComment #20
ndewhurstI 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.
Comment #21
ndewhurstP.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!
Comment #22
ndewhurstI updated the issue title and summary to clarify that it has multiple symptoms, outline those symptoms in a consistent format, etc.
Comment #23
ndewhurstComment #24
ndewhurstComment #25
anybodyThere 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?
Comment #26
ndewhurstPatch re-rolled against latest dev version.
Comment #27
ndewhurstPatch for version 8.x-1.5
Comment #29
ndewhurstNote: 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
Comment #31
honza pobořil commented