Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Hi,
I am using views3rc1 (drupal7.8), and have a simple gallery set up, whereby the teaser content of a gallery node is output. The view is served as an entity view, using search_api and entity.
On the views page the items per page selector works fine, however the All option fails to display any nodes/content.
Also, on a side note, when I expose the pager's Items per page selector it does not function correctly in preview.
I don't think I've set anything up wrong, does anyone have any ideas?
Comment | File | Size | Author |
---|---|---|---|
#17 | 1285794--views-pager-show-all-17.patch | 1.14 KB | drunken monkey |
#7 | 1285794--views-pager-show-all-7.patch | 850 bytes | drunken monkey |
#3 | exposed_all_filter.txt | 3.25 KB | ZuluWarrior |
#3 | All_option.jpg | 144.46 KB | ZuluWarrior |
#3 | show_9_option.jpg | 251.95 KB | ZuluWarrior |
Comments
Comment #1
dawehnerCould you provide an export of the view and a screenshot? It's kind of hard to follow what you exactly did.
Comment #2
dawehnerUpdate status.
Comment #3
ZuluWarrior CreditAttribution: ZuluWarrior commentedHere's some info, please find attached an export of the view, and a couple of screenshots, one proving the 'number of items to show' exposed works when set, the other showing the empty output when selecting 'All'.
I notice that in order for the number of results to match the number displayed in the drop down when the page first loads, you have to set the 'Items per page' of the pager to the same number as the first in your drop down list. Any other vlaue in 'items per page' causes incorrect results.
Comment #4
ZuluWarrior CreditAttribution: ZuluWarrior commentedComment #5
dawehnerOh wait this could be a problem of search_api. Did you tryed it with a normal view page, for example nodes?
By manually trying it out, it works as expected.
Comment #6
ZuluWarrior CreditAttribution: ZuluWarrior commentedThanks dereine,
you my well be right there, so I've (attempted) to move the issue to search_api
Comment #7
drunken monkeyDidn't know there was such an option, but the attached patch should fix this oversight.
Please try it out!
Comment #8
shiff2kl CreditAttribution: shiff2kl commentedI had this issue as well. I applied the patch and it now works as expected. Thanks.
Comment #9
sun-fire CreditAttribution: sun-fire commentedThe patch from #7 works for me.
Comment #10
dawehnerWhat about for checking either limit of offset?
Comment #11
adel-by CreditAttribution: adel-by commentedpatch at #7 works for me.
Thanks
Comment #12
shiff2kl CreditAttribution: shiff2kl commentedPatch #7 works for me. Can this get included into the module?
Comment #13
phenaproximaThe patch in #7 worked for me too. Thank you, drunken monkey!
Comment #14
r2integrated CreditAttribution: r2integrated commentedConfirming #7 works. Cheers!
Comment #15
Anonymous (not verified) CreditAttribution: Anonymous commentedChanges in #7 work fine to fix the "View all" issue with search api (solr) based views.
There is still a problem when using the view with a contextual filter (/taxonomy/term/%). In this case, as soon as the filter "Items per page" is exposed, I always get an empty output (even when selecting a specific number of items per page). I took a look at Solr logs, and the query is not even performed.
Has anyone experienced anything similar?
Thanks!
Comment #16
Anonymous (not verified) CreditAttribution: Anonymous commentedAnd, as usual, I've found the answer after posting here!
I had wrongly set the "user input required" in the exposed filter options.
BTW It would be nice to see this patch committed. Thanks!
Comment #17
drunken monkeyIf you've successfully tested a patch (especially if you aren't the first one), then please set the status to "reviewed & tested by the community". Otherwise, I'm bound to overlook some already tested patches.
Anyways, thanks for bumping, and thanks to you all for testing! Funny, that an 18-months-old patch still applies perfectly …
However, right before committing I stumbled upon another view of mine which I have set to show no (0) items. With the patch applied, it now too showed all items, which is of course not desirable. I had therefore to come up with a new patch, which you can find attached. The problem is that Views is incosistent in the value it uses to specify “All items” – see #2004580: $query->limit should be NULL if "All" option is selected. In the attached patch, I just work around the fact, hoping a possible solution for the Views issue won't break this fix.
I also incorporated the critique in #10, which was of course also true: there might still be an offset, even if all items are shown.
So, please test the attached patch to see if it, too, fixes the bug for you. Then I can finally get it committed.
Comment #18
drunken monkeyComment #19
Anonymous (not verified) CreditAttribution: Anonymous commentedUpgraded to Search API 7.x-1.6. "View All" shows no results.
Reapplied patch in #17. "View All" works fine. All other searches I have defined in my website work as well.
Comment #20
drunken monkeyExcellent, thanks for testing again!
Committed.