Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.12
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 Jul 2008 at 16:18 UTC
Updated:
18 Jun 2011 at 10:31 UTC
in custom_pagers.php : 233
// $Id: custom_pagers.module,v 1.6 2008/06/17 21:20:32 eaton Exp $
elseif (module_exists('views') && $view = views_get_view($pager->view)) {
// Get arguments for the view.
if (isset($pager->args)) {
$args = explode("\n", $pager->args);
if (module_exists('token')) {
$args = token_replace($args, 'node', $node);
}
$view->set_arguments($args);
}
// Make sure the query is not cached
$view->is_cacheable = FALSE;
$view->execute();
is this enough to handle with Items to display?
I have a View and STRAIGHTFORWARD SET 50 items! pager appear only on first 10 (ten) nodes. why?
i found only such code Views
// $Id: view.inc,v 1.115 2008/07/02 19:21:47 merlinofchaos Exp $
// pager variables
var $pager = array(
'use_pager' => FALSE,
'items_per_page' => 10,
'element' => 0,
'offset' => 0,
'current_page' => 0,
);
So question is - when it was beauty and strong?
Comments
Comment #1
merlinofchaos commentedThis looks like your real question is about custom pagers.
Comment #2
Andrey Zakharov commentedis view::execute respect Items to display property of default Display????
view.inc : 676
Comment #3
merlinofchaos commentedYou know, if Views didn't respect these fields from the displays, there'd be thousands of bug reports.
The fields are copied from the display into the $view as part of execute_display, which is not run here.
Comment #4
dergachev commentedsee this http://drupal.org/node/315032#comment-1134689
Comment #5
merlinofchaos commentedIt appears my clarification was to terse to be understood by people not plugged into the code. =)
The normal routine for displaying a view involves calling $view->execute_display() or $view->preview().
If one of these two functions is *not* called, then pager data from the display does not get copied to the view, and it remains at whatever the view's default settings were at. Therefore, it is imperative that you run the pre_execute phase manually.
Please examine view::execute_display() and/or view::preview() in view.inc to see what this does.
Comment #6
sinasalek commentedNo matter how many different way i tried (including the suggestion mentioned here), views still ignore the overidded pager values :(
When i var_export views before executing it, i can clearly see that the new paging values are applied. however after they don't have any affection on the result!
I don't really know what else i can do. What's wrong with this code?
Comment #7
sinasalek commentedTurned out to be a caching issue! Fixed using the following code