Hi

Suddenly I've found something I think is a bug, a view pager disappeared.

1.- I had a working view embeded in a page with a pager at the bottom. I used this php snippet:

    $view = views_get_view('portada_noticias');
    print views_build_view('embed', $view, array(), true, 2);

...as you can see I have pager activated with "true" and I just show two items in each page.

2.- In the view configuration I also have the pager activated (I'm not sure but I think it doesn't matter).

3.- I had problems with the pager not showing in the last page.

4.- Yesterday, suddelny with no configuration changes, the pager totally disappeared. But it seems it still works since you can change the page from the url:

http://pixelgordo.com/?page=2

Does anyone knows where could be the error or is it actually a bug?

Kind regards and thanks in advance.

PD.- Here is the code from the view if it helps:

  $view = new stdClass();
  $view->name = 'portada_noticias';
  $view->description = '';
  $view->access = array (
);
  $view->view_args_php = '';
  $view->page = TRUE;
  $view->page_title = '';
  $view->page_header = '';
  $view->page_header_format = '4';
  $view->page_footer = '';
  $view->page_footer_format = '4';
  $view->page_empty = '';
  $view->page_empty_format = '4';
  $view->page_type = 'teaser';
  $view->url = '';
  $view->use_pager = TRUE;
  $view->nodes_per_page = '10';
  $view->sort = array (
    array (
      'tablename' => 'node',
      'field' => 'created',
      'sortorder' => 'DESC',
      'options' => 'normal',
    ),
  );
  $view->argument = array (
  );
  $view->field = array (
  );
  $view->filter = array (
    array (
      'tablename' => 'workflow_node',
      'field' => 'sid',
      'operator' => 'OR',
      'options' => '',
      'value' => array (
  0 => '5',
),
    ),
  );
  $view->exposed_filter = array (
  );
  $view->requires = array(node, workflow_node);
  $views[$view->name] = $view;

Comments

NoRandom’s picture

Sorry, I forgot to point that the affected view is in the left column.

merlinofchaos’s picture

Status: Active » Postponed (maintainer needs more info)

Are there other pagers on the same page? Especially if you have another pager on the same page (such as when viewing a node or the site frontpage) you need to be sure to adjust the pager element ID so they don't conflict.

NoRandom’s picture

No, the other two views (in the right column) has the pager property set to FALSE.

NoRandom’s picture

I've tried clearing views cache and also cloning the current view and it's still wrong, so it doesn't seem to be a cache problem.

...you need to be sure to adjust the pager element ID so they don't conflict.

How do I change the pager element ID, merlinofchaos?

Thanks in advance.

UPDATE:

An extra bit of information, I removed the other views from the main page and the bug remains. So, it seems the problem is in the view itself or in its content.

UPDATE 2:

If I change True to 'True' (between two ' ), the pager appears but it doesn't work. In the URL I get this when I try to change the page:

http://pixelgordo.com/?page=%2C2

So I realised the error comes from the links is. I've checked the translation for those link titles and it's correct: "Ir a la página @number"

So, where does the coma (%2C) come from?

If I put 1, the pager doesn't appear at all.

NoRandom’s picture

Another extra bit of information:

  1. If I create a new view an I put it instead of the original the bug persists => I assume the bug doesn't come from a corrupted view or something like that.
  2. If I change the view to a list view, the pager appears with the same php snippet => I assume the error comes from the teaser view.

So, I made some changes to get more information from the bug:

I changed the php snippet no show just one node per page and I surfed through pages from URL manually adding ?page=[numbers here] and here are the results:

PAGE 0: Node type = "version", pager NOT shown: http://pixelgordo.com/?page=0

PAGE 1: Node type = "noticia", pager SHOWN: http://pixelgordo.com/?page=1

PAGE 2: Node type = "juego", pager NOT shown.

PAGE 3: Node type = "noticia", pager SHOWN.

PAGE 4: Node type = "juego", pager NOT shown.

PAGE 5: Node type = "juego", pager NOT shown.

PAGE 6: Node type = "noticia", pager SHOWN.

...

So, it seems the problem is with the custom node template I made for "juego" and "version" node types. What should I check inside these templates wich can make pager stop working?

Thanks in advance.

PD.- The end is near :D

netbear’s picture

I already commented in another topic but may be this one is more related/

I've created views with page and block display.
And for default and page display i set pager "on" and items 10 per page - everything ok, works
For my blocks i set 4 items and block appeared as it should. But there was pager for each block which was not needed and i've set pager to "off" for block display in my views and blocks disappeared.

NoRandom’s picture

I've rebuilt from the ground one of the problematic custom node templates and the pager is working now. I still have to compare the two templates (the problematic and the right one) to see what's the code wich generates the problem with the pager.

Kind regards.

PS.- I progress really slow because I have no time and I use drupal for my personal site.

netbear’s picture

My problem is solved, everything works as it should.

NoRandom’s picture

I'm having weird behaviour with templates... some times pager appear and also a strange margin over the nodes. I'm starting to think this issue could be related with character encoding in the templates...

Since I discovered I can change the character encoding with notepad++ (I use it to create and edit html) I changed the encoding to UTF-8 in some of the templates because it allows me to write more readable code using spanish characters like á é í...

But I don't have enough time yet to check it...

esmerel’s picture

Status: Postponed (maintainer needs more info) » Active
khan2ims’s picture

Hi,

For me, the pager is not showing up if I set the Row Style to "Node". If I keep it fields and add in fields, then the pager shows up. And it doesn't matter if I have multiple views on that page with pager enabled.

F1 F1 F1 !!

merlinofchaos’s picture

Status: Active » Fixed

If you've set the row style to node and have enabled comments, note that comments come with their own pager, and its pager id is always set to 0. That will conflict with the larger pager.

Status: Fixed » Closed (fixed)

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

egarias’s picture

Version: 5.x-1.6 » 6.x-2.8

I have strange behaviour with pager.
This all happens in the views UI.
I have a view with node.id as argument
When i don't pass the argument, the pager is ok. When i pass the argument with a node id:
The pager dissapears, and if i increase the "items per page" from 4 to 8 for example, i can see the 8 elements so i don't understand why the pager is not present when "items per page" = 4.

Please help, i have been checking almost everything i know with no success.
here is the code of my view:

$view = new view;
$view->name = 'imagenes_articulo';
$view->description = 'imagenes_articulo';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
  'field_thumbnail_image_fid' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 1,
    'empty_zero' => 1,
    'link_to_node' => 0,
    'label_type' => 'none',
    'format' => 'imagefield__lightbox2__featured_image__original',
    'multiple' => array(
      'group' => 0,
      'multiple_number' => '',
      'multiple_from' => '',
      'multiple_reversed' => 0,
    ),
    'exclude' => 0,
    'id' => 'field_thumbnail_image_fid',
    'table' => 'node_data_field_thumbnail_image',
    'field' => 'field_thumbnail_image_fid',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'nid' => array(
    'label' => 'Nid',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 0,
    'exclude' => 1,
    'id' => 'nid',
    'table' => 'node',
    'field' => 'nid',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('arguments', array(
  'nid' => array(
    'default_action' => 'ignore',
    'style_plugin' => 'default_summary',
    'style_options' => array(),
    'wildcard' => 'all',
    'wildcard_substitution' => 'Todos',
    'title' => '',
    'breadcrumb' => '',
    'default_argument_type' => 'fixed',
    'default_argument' => '',
    'validate_type' => 'none',
    'validate_fail' => 'not found',
    'break_phrase' => 0,
    'not' => 0,
    'id' => 'nid',
    'table' => 'node',
    'field' => 'nid',
    'validate_user_argument_type' => 'uid',
    'validate_user_roles' => array(
      '2' => 0,
      '3' => 0,
      '7' => 0,
      '5' => 0,
      '4' => 0,
      '6' => 0,
    ),
    'relationship' => 'none',
    'default_options_div_prefix' => '',
    'default_argument_user' => 0,
    'default_argument_fixed' => '',
    'default_argument_php' => '',
    'validate_argument_node_type' => array(
      'blog' => 0,
      'ad' => 0,
      'panel' => 0,
      'articulo' => 0,
      'audio' => 0,
      'date' => 0,
      'edicion_papel' => 0,
      'encuesta' => 0,
      'feed' => 0,
      'feeditem' => 0,
      'mercado' => 0,
      'page' => 0,
      'precios' => 0,
      'resource' => 0,
      'simplenews' => 0,
      'topichub' => 0,
      'twitter_item' => 0,
      'ultima_hora' => 0,
      'video' => 0,
    ),
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(
      '44' => 0,
      '1' => 0,
      '40' => 0,
      '43' => 0,
      '2' => 0,
      '3' => 0,
      '4' => 0,
      '5' => 0,
      '6' => 0,
      '7' => 0,
      '8' => 0,
      '41' => 0,
      '9' => 0,
      '10' => 0,
      '11' => 0,
      '12' => 0,
      '13' => 0,
      '14' => 0,
      '15' => 0,
      '16' => 0,
      '17' => 0,
      '18' => 0,
      '19' => 0,
      '20' => 0,
      '45' => 0,
      '21' => 0,
      '22' => 0,
      '23' => 0,
      '24' => 0,
      '25' => 0,
      '26' => 0,
      '27' => 0,
      '28' => 0,
      '29' => 0,
      '30' => 0,
      '31' => 0,
      '32' => 0,
      '46' => 0,
      '33' => 0,
      '34' => 0,
      '35' => 0,
      '36' => 0,
      '37' => 0,
      '38' => 0,
      '39' => 0,
      '47' => 0,
      '48' => 0,
    ),
    'validate_argument_type' => 'tid',
    'validate_argument_transform' => 0,
    'validate_user_restrict_roles' => 0,
    'validate_argument_php' => '',
  ),
));
$handler->override_option('filters', array(
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'articulo' => 'articulo',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('use_ajax', TRUE);
$handler->override_option('items_per_page', 4);
$handler->override_option('use_pager', 'mini');
$handler->override_option('style_plugin', 'grid');
$handler->override_option('style_options', array(
  'grouping' => '',
  'columns' => '4',
  'alignment' => 'horizontal',
));
$handler = $view->new_display('page', 'Página', 'page_1');
$handler->override_option('path', 'imagenes-articulo');
$handler->override_option('menu', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
));
ethnovode’s picture

I'm using the last dev version and I have the same problem. The pager shows when not using the argument but disappear when using a node id as argument.

Here is my view :
http://dl.dropbox.com/u/5523867/my-view-argument-problem-pager.txt

RikiB’s picture

Priority: Normal » Critical
Status: Closed (fixed) » Active

Same here ethnovode. I thought I was going crazy and tried many things, but there is indeed a huge bug with this.

If I use node ID as an argument or as a filter, the pager disappears, Ive narrowed it down to that. Is there anyway to quickly fix this?

dawehner’s picture

Version: 6.x-2.8 » 5.x-1.6
Priority: Critical » Normal
Status: Active » Closed (fixed)

Tthis is a old drupal5 issue. Please create a new one, and describe there whats wrong

The old code from drupal5 has nothing todo with the drupal6 code, so its logically wrong to change this issue.

bofrost’s picture

I have created a new one under http://drupal.org/node/788562.