Custom Pagers limited to 10 maximum?

herb - May 16, 2009 - 20:55
Project:Custom Pagers
Version:6.x-1.10-beta1
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

I'm calling this a support request because I expect that if it were a bug, someone with more experience would have already reported it.

Using the latest updated versions via CVS of everything, I have two custom pagers for two different cck types. In each case when there are more than 10 items to be paged, the pagers always show x of 10 regardless of the actual number of items being greater than 10. (The pager is missing from all nodes beyond 10.)

One CCK custom pager is set up by node type, and uses a view (with 0 or unlimited items to display in the view) that takes a view argument using the token [field_trip_name-nid] - a relationship in the view. (Although in the Views argument it is expressed as a default argument using PHP argument code)

In the second CCK custom pager example, it is also set up by node type, and uses a view (with 0 or unlimited items to display in the view) that takes a view argument using the token [term-id] - (Although in the Views argument it is expressed as a default argument using PHP arguement code)

Have I committed some major blunder? I looked for some possible default setting of 10 but found nothing, so I'm stumped. I've previously themed the functionality under Drupal5, but I was hoping to use the "official module" if possible.

Thanks if you can help!!

#1

psynaptic - May 21, 2009 - 13:59

I'm having the exact same problem. On node 10 of my view results it doesn't have a next link. Looking into it now. Can't seem to see anything in the module that would cause this.

#2

psynaptic - May 21, 2009 - 14:12

It seems that $view->pager['items_per_page'] is 10 no matter what my views settings.

#3

psynaptic - May 21, 2009 - 16:13

Ok, it looked like we needed to be able to select which display to use. I created a patch that applied to the beta rather than the dev. I added the ability to select which display to use and save it to the db. Then use $view->preview to get the right data. Was working great until I looked at dev and someone (eaton?) has already gone around the issue another way.

I'll try and see if I can add my patch to the new dev version and see if you like it.

Related posts:

#279925: views and custom_pagers works strange (view->execute)

#4

herb - May 21, 2009 - 23:33

Thank You! - I thought I was doing something wrong since no one else had reported it. I'll check out the latest Dev and see if that resolves the issue and/or wait till a patch is available. Should this be changed to a "bug report"?

#5

amethyst - May 22, 2009 - 17:35

I encountered the same and found the limiting number in modules/views/includes/view.inc (v 1.151) line 34-40 var $pager...
There 'items_per_page' is set to 10. After patching there to 100 or 0 (assumed to be infinite) it worked fine. But I'm totally new to Drupal and PHP and this is hacking, I admit. So is it a bug in views module?

#6

psynaptic - May 22, 2009 - 22:47

It's not a bug in Views, they are just required defaults.

Did you try the latest dev of custom_pagers?

#7

herb - May 23, 2009 - 13:35

I just tried the latest dev and it seems to work now! Many thanks to the maintainer.

#8

J0nathan - September 24, 2009 - 01:05

subscribing

#9

doublejosh - September 29, 2009 - 00:34

Doing so also.

#10

mcsolas - October 14, 2009 - 18:07

Subscribing.. Same issues for me. In my case, I have managed to get this working.. I used to see from 1 to say.. my 1000th node.

Today, it reverted back to showing max 10 !!

Not sure why.. I havent touched the settings.

All we have been doing is posting... now I guess.. its time to go back in and take a look.

#11

geerlingguy - October 18, 2009 - 05:41

I am having the same problem... will try latest -dev release to see if it helps.

Node in question: http://www.lifeisaprayer.com/photos/2009/1261

[Edit: Updating to the latest -dev release did work. Thanks!]

#12

henrrrik - October 19, 2009 - 09:14

It would be nice to have the latest 6.x-1.x-dev rolled out as a 1.10beta2.

#13

zzadik - October 25, 2009 - 12:50

I had the same problem, and managed to solve it by hacking the beta1 version.

Until the beta2 version is out, you can try using the following fix:

In custom_pager.module, locate the "custom_pager_build_nav" function and look for:

<?php
// Make sure the query is not cached
     
$view->is_cacheable = FALSE;
     
$view->execute();
?>

Now modify it to include the following 2 calls (init_display & pre_execute):

<?php
// Make sure the query is not cached
     
$view->is_cacheable = FALSE;
     
$view->init_display(); 
     
$view->pre_execute();
     
$view->execute();
?>

Hope it helps until the dev version becomes beta2

#14

tanot - November 4, 2009 - 05:31

Thanks a lot zzadik, your solution indeed work :)

#15

Danny_Joris - November 27, 2009 - 22:07

#13 , zzadik's solution works for me as well. Hopefully beta2 will be out soon.

Thanks!

#16

davepoon - November 29, 2009 - 13:09

Thanks zzadik.
Looking forward to the final release.

#17

djmy - December 1, 2009 - 22:46

had the same issue and just installed the dev version it works now!

 
 

Drupal is a registered trademark of Dries Buytaert.