Using the latest recommended 6.x versions of Views and Custom Pagers, I set up a view to be used for a pager to page through all story posts. The view returns all 11 "Story" items which I want to be paged through; the pager is set to use this view and display on "Story" nodes as a block, and the block is added to the sidebar. However, the pager only pages through 10 of the 11 items. I've deleted and re-created both the view and the pager, cleared caches, disabled block caching; nothing. Custom Pagers still only sees 10 items.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

huayen’s picture

Notice this post right before I post a bug report.....I got exactly the same problem.

Reinstalled module, cleared cache....none solve it.

huayen’s picture

Priority: Normal » Critical

I think this is a critical bug, since it completely prevents the goal of this module. Hope this can be fixed asap. Thanks.

Andrey Zakharov’s picture

Andrey Zakharov’s picture

Status: Active » Needs review

found solution:

@@ -1,6 +1,6 @@
 <?php
 // $Id: custom_pagers.module,v 1.6 2008/06/17 21:20:32 eaton Exp $
-
+//modified by Vaulter (http://vaultsoft.ru) 2008/07/08 21:10 vaulter
 /**
  * Implementation of hook_menu().
  */
@@ -242,7 +242,7 @@
 
       // Make sure the query is not cached
       $view->is_cacheable = FALSE;
-      $view->execute();
+      $view->execute_display();
 
       if (isset($view->result)) {
         foreach($view->result as $result) {
@@ -316,4 +316,5 @@
   $vars['suggestions'][] = "custom-pager-$node->type-{$vars['position']}";
   $vars['suggestions'][] = "custom-pager-$pager->pid";
   $vars['suggestions'][] = "custom-pager-$pager->pid-{$vars['position']}";
+  $vars['template_files'] = $vars['suggestions'];
 }
samirnassar’s picture

Status: Needs review » Reviewed & tested by the community

While not in a patch file the modified code works as advertised and didn't eat my children.

stellarvisions’s picture

I have 16 items in the view, displaying 4 per page.

The pager, with this patch, is now saying "1 of 4" not "1 of 16"

stella

Stellarvisions

epikur79’s picture

Im using a view with arguments and have the same problem. Applying the patch above does not help.

Adding
$view->pager['items_per_page'] = 0;
just before
$view->execute();
solves the issue for me however.

webchick’s picture

Status: Reviewed & tested by the community » Needs work
hansamurai’s picture

I have the same problem, you can see it in action on my site, here's a link to the view page where there are more than 10 items but only the 10 most recent appear in the custom pager (click on one of the nodes near the top, the pager is in the sideblock).

http://firsthour.net/first-hour-review

Edit: epikur79's fix works for me, so you can't see it broken anymore. Sorry! :)

MGN’s picture

I've tried both Vaulter's and epikur79's solution on views with and without arguments, on three different content types. Vaulter's patch doesn't solve the problem - still getting fewer items in the pager than in the view. epikur79's solution works in all the cases that I have tested.

spiffyd’s picture

Component: User interface » Code

Can someone roll epikur79's solution into a patch? Thanks

spiffyd’s picture

Attached is the module with epikur79's suggested changes. IT works for me and fixes the problem.

Anonymous’s picture

worked for me too, but noticed that the text 'prev post' and 'next post' are not used with the t function...

should be => t('prev post') and t("next post")

Should I post this as a feature request ?

spiffyd’s picture

You can try to roll a patch on this thread.

TomMynd’s picture

Hi,

the file from spiffyd works for me too.

Best regards, Tom

Anonymous’s picture

the file that was provided does not work from me. i still only see 10 items instead of the 24 that i have.

has anyone found another solution?

clau_bolson’s picture

Use epikur79's solution.
The file to modify is custom_pagers.module.

Anonymous’s picture

My views is set to 24 items and I used epikur79's solution but i still only get 10.

Anonymous’s picture

never mind i got it working

Anonymous’s picture

how ? What was your problem ? Maybe your solution might help others like you...

Anonymous’s picture

it had to do with both solutions. i did #4 then #7 but with installing the current module then only do solution #7 it works fine.

it turns out it was an error on my part.

dergachev’s picture

Flying Drupalist’s picture

Please commit?

Mark Theunissen’s picture

Subscribing

yoeld’s picture

Does not work for me. I have 18 items, but custom pagers sees only 10 ... . Moreover, it does not respect the sorting order as I defined in the view.

joshuast’s picture

subscribing

robertDouglass’s picture

Status: Needs work » Reviewed & tested by the community

Confirm that this patch fixes the problem:

       // Make sure the query is not cached
       $view->is_cacheable = FALSE;
+      $view->pager['items_per_page'] = 0;
       $view->execute();
 
       if (isset($view->result)) {

(Sorry for no real patch)

robertDouglass’s picture

Version: 6.x-1.10-beta1 » 6.x-1.x-dev

Confirm that this patch fixes the problem:

       // Make sure the query is not cached
       $view->is_cacheable = FALSE;
+      $view->pager['items_per_page'] = 0;
       $view->execute();
 
       if (isset($view->result)) {

(Sorry for no real patch)

awakenedvoice’s picture

Subscribing. I'm seeing the same issue on a development site I'm building. The view returns more than 10 items but the page only goes up to the 10th item. You can see it in action at http://new.julietlofaro.com/gallery.

Rob Safuto

awakenedvoice’s picture

I have made the adjustment in #28 and it works on a one page view. Where previously I could page to 10 of 14 items I can now I can page to all of the items on the page.

Rob Safuto

nnewton’s picture

Last solution works for me.

Flying Drupalist’s picture

Commit perhaps?

Standart’s picture

Title: View returns 11 items; pager only sees 10 » Turn off paging for view (pager only sees 10 items)
FileSize
587 bytes

Patch against 6.x-1.x-dev.

Mark Theunissen’s picture

Please commit.

eaton’s picture

Status: Reviewed & tested by the community » Fixed

Committed to the 6.x 1.x dev branch, will be rolled into a new release shortly. Thanks!

Mark Theunissen’s picture

Thank you!

Status: Fixed » Closed (fixed)

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

garywg’s picture

Thank you for posting this. This fixed my problem. Thanks epikur79. The posting advice is right. If you look a little bit you usually find the answer.
garywg

krisrobinson’s picture

I had this problem as well, I upgraded to the latest dev release with the committed fix and solved my problem. Thanks a million.

argosmm’s picture

Thanks Denis
worked for me too