I created a block that displays 5 items that have been promoted to the frontpage. It offsets this list by 5 items. i.e. Let's say nodes 1-14 are promoted to the front page. It will display nodes 6-10.
I have added a pager to this and it shows 3 pages. When their should only be two. nodes 6-10 and then nodes 11-14.
If I remove the offset it still shows 3 pages and displays them correctly. nodes 1-5, nodes 6-10 and nodes 11-14.
So I think that the pager does not honor the offset supplied in the query. If you give me a hint on which file to look at I can look at submitting a patch.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | pager.patch | 856 bytes | redndahead |
Comments
Comment #1
merlinofchaos commentedI believe line 658 of views.inc is what we need. Total rows isn't accounting for the offset and it probably should.
This line:
Should probably be
If you could test that this works, this could be an easy fix.
Comment #2
redndahead commentedhmm my line 658 has this:
And through some testing I had did earlier I changed it to this:
I was running into an ajax error: An error occurred at /views_cck/views/ajax
I tracked that down to include/ajax_view.js
If you comment out lines 91-110 everything works perfectly. I'm positive it's in the .ajax call, but I haven't had the time to look into what it is. Being my first time looking inside of views it would take me a while to figure that out. Hopefully you can come up with it before me.
Comment #3
redndahead commentedHere is a beginning patch file. Also moving version to dev since this patch is against head.
Comment #4
redndahead commentedduh the patch needs work.
Comment #5
merlinofchaos commentedComment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.