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:
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
Comment #1
NoRandom commentedSorry, I forgot to point that the affected view is in the left column.
Comment #2
merlinofchaos commentedAre 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.
Comment #3
NoRandom commentedNo, the other two views (in the right column) has the pager property set to FALSE.
Comment #4
NoRandom commentedI'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.
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:
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.
Comment #5
NoRandom commentedAnother extra bit of information:
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
Comment #6
netbear commentedI 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.
Comment #7
NoRandom commentedI'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.
Comment #8
netbear commentedMy problem is solved, everything works as it should.
Comment #9
NoRandom commentedI'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...
Comment #10
esmerel commentedComment #11
khan2ims commentedHi,
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 !!
Comment #12
merlinofchaos commentedIf 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.
Comment #14
egarias commentedI 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:
Comment #15
ethnovode commentedI'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
Comment #16
RikiB commentedSame 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?
Comment #17
dawehnerTthis 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.
Comment #18
bofrost commentedI have created a new one under http://drupal.org/node/788562.