I've just upgraded views from 6.x.2-rc3 to 6.x.2.0. Suddenly some of my pagers are missing. Excerpt from exported view:

$handler->override_option('items_per_page', 5);
$handler->override_option('use_pager', '1');

I always get the defined number of nodes displayed (e.g. 5), but no pager. Views UI says "Use pager: Yes" and "Items per page: 5", so this seems o.k. for me. What can I do?

Regards,
Boris B.

By the way: Views 2.0 is REALLY GREAT WORK!!!

CommentFileSizeAuthor
ExportedView.txt3 KBdrubb

Comments

merlinofchaos’s picture

I realize this is a silly question, but are you sure the view actually has > 5 results? You won't see any pager if there isn't another page.

drubb’s picture

No matter, this would be my first question, too. There ARE more than 5 entries, increasing the value from 5 to 10 e.g. gives a list with 10 Nodes...

This is the Views SQL Data:

Views plugins build time: 18.496 ms
Views data build time: 2.635 ms
Views handlers build time: 1.118 ms
SELECT node.nid AS nid,
node.sticky AS node_sticky,
node.title AS node_title
FROM {node} node
WHERE (node.status <> 0 OR node.uid = ***CURRENT_USER*** or ***ADMINISTER_NODES*** = 1) AND (node.type in ('%s')) AND (node.language in ('%s', '%s'))
ORDER BY node_sticky DESC, node_title ASC

drubb’s picture

I've figured out some details:

This problem occurs when setting a language filter! Within my node type I've got 10 records, 4 of them language-neutral and 6 of them given a language. I've set up a node filter "language in (current users language, no language). Now Views shows only the number of nodes given as desired items per page, but no pager. Varying this value shows more (or less) nodes.

Hope this helps!

Regards,

Boris B.

drubb’s picture

And another test:

I've changed my language filter to use ALL available options, resulting in the following sql query:

...AND (node.language in ('***CURRENT_LANGUAGE***', '***DEFAULT_LANGUAGE***', '***NO_LANGUAGE***', 'de-d5', 'de-d6', 'de-d7'))
ORDER BY node_sticky DESC, node_title ASC...

The result is the same, the view always shows "items per page" records, but no pager.

As you can see, I'm using language subcodes, but I dont think that's the reason (as former queries didn't use them). Sorry, this looks like a bug to me. Good luck!

merlinofchaos’s picture

Status: Active » Postponed (maintainer needs more info)

I am unable to reproduce.

I created a simple view. Set use pager to Full pager. Set Node: title as the only field. Added Node translation: language as the filter. Set it to site language, user's language, etc. Pager comes up fine.

Generally if the pager disappears, it has more to do with a conflict in pager elements. If you have other content on the page that uses a pager, make sure they have different element IDs. Though this shouldn't be an issue with the live preview.

But I can't think of any reason for the pager to disappear. =(

drubb’s picture

Thx, we're on the way...

I've just changed my row style from "node" to "fields", with just the title field, and the pager appeared! Then changed back, and the pager didn't disappear, yeah. Then I've taken a look at the "settings for current row style". If I select "display node comments", the pager vanishes, unselecting this the pager reappears. Dont't know what this has got to do with the language filters, but there seem to be some strange interferences...

At the moment, it's done for me, thx a lot. If you would like to take a look at the page on my testsite:

http://drupal-info.pcsbb.de/d6/buchtipps

Regards,
Boris B.

merlinofchaos’s picture

Status: Postponed (maintainer needs more info) » Fixed

If I select "display node comments", the pager vanishes

Thus, your problem. Comments have a pager. They use pager element id 0. It will blow away the data for the pager you used.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

willhall-dupe’s picture

merlinofchaos - October 20, 2008 - 22:24
Status: active (needs more info) » fixed

If I select "display node comments", the pager vanishes

Thus, your problem. Comments have a pager. They use pager element id 0. It will blow away the data for the pager you used.

Just a heads up -- spent about an hour trying to figure out why my view lost its pager... i had "display node comments" set. It think it's a bug for the pager to disappear like this...

thanks - will

esmerel’s picture

just repasting what merlin suggested and was said in IRC:

The comment pager comes from core, not from views, and so this is not really a views thing - everybody assumes their pager id will be 0, and there doesn't seem to be a way to detect multiple pagers.

SO, if you run into this problem:

Open the view, go into the pager settings, and change the element ID to 1 or, don't display comments in a teaser list.