Closed (fixed)
Project:
Search API
Version:
7.x-1.x-dev
Component:
Views integration
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Nov 2013 at 03:45 UTC
Updated:
11 Sep 2014 at 14:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
drunken monkeySee #2135255: Pager missing on first page of search results due to bug in how views pager plugin is invoked. Should be fixed in dev.
Comment #2
johntang commentedSorry for re-open this issues, I have been updated to 7x.10, but my issues not resolve. I viewed complete list of changes for "Fixed missing pager on first page of search results" is fixed, but on my case it still not fixed.
The pager not showing up on all pages. I'm type ?page=0 or ?page=1, etc it's working.
Please have a look.
Comment #3
johntang commentedComment #4
drunken monkeyHm, OK. Did you clear the cache after updating, and maybe tried to re-save the view's settings?
Otherwise, please describe how to reproduce the bug, i.e., what steps you execute and what happens.
Comment #5
johntang commentedMy views is normal with other views, in order to show the result to the page /games. I have tried to clear cache, change Pager ID, check logs but its nothing.
On 7.x-1.8 version, it's working perfect when update to 7.x-1.9 and 7.x-10 pager not show.
I changed to pager setting to Infinite Scroll also, it still won't work. :(
Comment #6
drunken monkeyPlease try to reproduce this without all your custom settings, from just a normal view using common node properties. I cannot import a view which contains your custom fields.
Especially, try whether it still fails if you remove all the PHP fields/areas. This might influence the pager's behavior. Also try to remove other handlers provided by other modules.
Comment #7
johntang commentedI think I determine the cause of Pager is not showing, when I create new views with name is "testing" and some fields, Pager working fine. But when add Global: PHP (PHP) field to FIELDS, Pager is not display. So I think it's caused from PHP field.
On my old views with a handler modules, when I remove Global: PHP field, its working too.
Please have a look, thanks
Comment #8
drunken monkeyIf the PHP field is the cause, then please move this issue to the module providing that field.
Comment #9
drunken monkeyAlso, #1634620-17: Flag module integration? mentions the same problem.
Comment #10
johntang commentedYes, I do follow https://drupal.org/comment/8169759#comment-8169759, and now it working.
Comment #11
timkang commentedI also have a project using both Views PHP and Search API with this same issue, and I believe it's caused by
SearchApiViewsQuery::$query::range()being called beforeSearchApiViewsQuery::$pager::pre_execute():The default views query plugin (views_plugin_query_default) demonstrates the proper order:
I've rolled a patch to move the call to
$query::range()down into theexecute()method.How this relates to Views PHP and johntang's original issue
The Views PHP module has a pager plugin (views_php_plugin_pager) that doesn't paginate, but actually removes query limits and offsets (in
views_php_plugin_pager::pre_execute()), so that it can perform custom PHP filtering over the full result set. It assumes whatever results are returned by the query to be full set (because it removed the offset and limits) and sets$total_itemsof the actual pager to the number of remaining results after filtering. When the query range is set too early, though,$total_itemsis at most equal to the number of results on single page, and the pager thinks there is only one page of results, thus no pager is shown.It's a bit convoluted, so let me know if there's anything I can clarify or explain further.
Comment #12
timkang commentedComment #13
timkang commentedComment #14
drunken monkeyGood to hear.
Comment #15
johntang commented12: 2146435.patch queued for re-testing.
Comment #16
johntang commentedAwesome, #2146435.patch working perfect and I think its no related to PHP Views module.
Comment #17
drunken monkeyAh, excellent, thanks for figuring that out and providing a patch! (And sorry I cross-posted on you!)
Good that at least some people understand Views … (Or dare to try and debug it.)
I've committed your patch now. Thanks a lot again!
Comment #19
johntang commentedHi again, I have been updated to last of Search API version, but the problem is meet again, no paging until I use the patch. I think this patch does not commit on the last version, please have a look.
Comment #20
gthing commentedRe-opening to request a project commit.
Comment #21
drunken monkeyIt was already committed. However, it seems #2204847-2: SearchApiViewsCache does not function correctly with pagination.. re-introduced the problem. I didn't think of that.
So, please see if the attached patch solves the problem for you again.
(Memo to self: Credit alanmackenzie for this patch.)
Comment #23
drunken monkeyStupid "feature" …
Comment #24
drunken monkey21: 2146435-21--custom_pager.patch queued for re-testing.
Comment #25
Colin @ PCMarket commentedThis patch helped me restore pagination, please commit
Comment #26
elpino commentedTested, this patch fixes the problem.
Comment #27
drunken monkeyGood to hear. Committed.
Comment #30
dariogcode commentedHi,
I'm using the latest version 1.13 and having same issue, no pager in search api views.
My views use better exposed filter as contrib modules there, but I think that dosn't matter, export view:
Comment #31
drunken monkeyThat's weird. Did it work with earlier versions? If yes, which?
Can you reproduce in a simpler scenario, without other contrib modules and preferably only fields from the standard installation? (Otherwise, I can't import.) Please also don't post the export directly in the comment, that's a pain to scroll through – use GitHub Gists or something similar, or attach it in a text file.
Comment #32
dariogcode commentedThanks for answer and sorry about the big paste, I will use gists in the future.
I found the problem, it was caused by EVA module, when in the view I displayed a node with eva field (example: a teaser list), pager didn't work.
The issue is reported here: https://www.drupal.org/node/1926720
Thanks for your patience!
Comment #33
drunken monkey