This problem confronted me in 6.x-2.5, so I just updated to 6.x-2.6. Problem persists. Here it is:

I've overridden the views_views_mini_pager() function using mytheme_views_mini_pager() as such things usually go, and the middle section (saying "1 of 19") appears at the bottom of my block. But the prev and next links fail to appear on any page, even when I leave the function completely unchanged (except for the "mytheme" name). This problem occurs both with and without AJAX.

So in order to see (and theme) the pager links, I had to hack the theme.inc file. And I don't want to do that!

Comments

As If’s picture

CORRECTION TO ABOVE POST: "views_views_mini_pager()" should say "theme_views_mini_pager()".

kostask’s picture

I have the exact same issue. I was trying to replace the ‹‹ and ›› with images and tried to override the theme_views_mini_pager by copying it to template.php and renaming to {my_theme_name}_views_mini_pager.

Doing just this makes the arrows (‹‹ and ››) disappear and any changes to {my_theme_name}_views_mini_pager at template.php regarding the $li_previous and $li_next do not render at all.

All other modifications I tried work as expected.

The only way I found to put arrows instead of ‹‹ and ›› was to hack the core theme.inc file which is not something I wish to be doing.

kostask’s picture

Issue tags: +theme, +views, +mini pager, +theme override

As this issue is still not resolved, could someone point us at the right direction as to start debugging views to find out where this problem is caused?

I would be glad to help as I really do not want to hack drupal core on a live project.

dawehner’s picture

Status: Active » Postponed (maintainer needs more info)

Could someone of you paste, what you are doing in your template.php?

<?php
function garland_views_mini_pager($tags = array(), $limit = 10, $element = 0, $parameters = array(), $quantity = 9) {
  global $pager_page_array, $pager_total;

  // Calculate various markers within this pager piece:
  // Middle is used to "center" pages around the current page.
  $pager_middle = ceil($quantity / 2);
  // current is the page we are currently paged to
  $pager_current = $pager_page_array[$element] + 1;
  // max is the maximum page number
  $pager_max = $pager_total[$element];
  // End of marker calculations.


  $li_previous = theme('pager_previous', (isset($tags[1]) ? $tags[1] : t('-«')), $limit, $element, 1, $parameters);
  if (empty($li_previous)) {
    $li_previous = "&nbsp;";
  }

  $li_next = theme('pager_next', (isset($tags[3]) ? $tags[3] : t('»-')), $limit, $element, 1, $parameters);
  if (empty($li_next)) {
    $li_next = "&nbsp;";
  }

  if ($pager_total[$element] > 1) {
    $items[] = array(
      'class' => 'pager-previous',
      'data' => $li_previous,
    );

    $items[] = array(
      'class' => 'pager-current',
      'data' => t('@current of @max', array('@current' => $pager_current, '@max' => $pager_max)),
    );

    $items[] = array(
      'class' => 'pager-next',
      'data' => $li_next,
    );
    return theme('item_list', $items, NULL, 'ul', array('class' => 'pager'));
  }
}
?>

I changed the text from the previous/next buttons.

@kostask
Can you explain your tagging?

kostask’s picture

I will post the code tomorrow when I 'll be close to my files :)

Dereine, what do you mean by explain my tagging? I am a bit new to the issue system and thought to add tags relevant to the question.

So mini pager as there is where the problem is focused theme and theme override as this how we are trying to modify the site and views being the module at hand. If it is an inappropriate way to do or if I am missing something, please correct me.

kostask’s picture

Status: Postponed (maintainer needs more info) » Active

Dereine, I have used your exact same code and I still face the same results. All my modules are up to date but the problem persists. The list of modules I use is:
Content Templates (Contemplate), CCK, Content Profile, Email Field, FileField, ImageAPI, ImageCache, ImageField, Lightbox2, Link, Login Destination, Poormanscron, Rules, Schema, Taxonomy Access Control Lite, Token, Views.

I am also using a subtheme of Zen. Since you do not seem to have the same problem, how do I proceed determining the error? Any help is greatly appreciated.

rakugaki’s picture

@dereine that works fine (great actually thx!) for me in my zen 1.0 subtheme.

sorry site is pre production so can't link.

merlinofchaos’s picture

Status: Active » Closed (won't fix)

Views calls theme('views_mini_pager').

Once your code takes control, it's no longer Views' code.

We have successfully verified that this works.

We cannot go into your site and debug your site for you.

dwb17’s picture

I have the same problem, when trying to override the function in my template.php file.
I am using zen-6.x-1.1, which seems to be the trouble, since when i changed my site's theme to garland and applied the override it worked.
Does anyone have any idea?

rakugaki’s picture

I did little more then copy paste the above code in to my zen sub theme's template.php. My sub themes are very heavily modified so that may have removed the problem and also my mini ajax pager is working on a pretty simple view that display's one item per page which maybe is avoiding problems that may occur with more complicated views.

Guess if i were you i'd disable everything and work of a dummy simple view and sub theme, then gradually re-enable modules and views and try and troubleshoot the problem by isolation. Sorry not very helpful :(

function template3_tcsa_views_mini_pager($tags = array(), $limit = 10, $element = 0, $parameters = array(), $quantity = 9) {
  global $pager_page_array, $pager_total;

  // Calculate various markers within this pager piece:
  // Middle is used to "center" pages around the current page.
  $pager_middle = ceil($quantity / 2);
  // current is the page we are currently paged to
  $pager_current = $pager_page_array[$element] + 1;
  // max is the maximum page number
  $pager_max = $pager_total[$element];
  // End of marker calculations.


  
  $li_previous = theme('pager_previous', (isset($tags[1]) ? $tags[1] : t(' ')), $limit, $element, 1, $parameters);
  if (empty($li_previous)) {
    $li_previous = "&nbsp;";
  }

  $li_next = theme('pager_next', (isset($tags[3]) ? $tags[3] : t(' ')), $limit, $element, 1, $parameters);
  if (empty($li_next)) {
    $li_next = "<a href='#'> </a>"; //if on the last page this link will send to user to the first page
  }

  if ($pager_total[$element] > 1) {
    $items[] = array(
      'class' => 'pager-previous',
      'data' => $li_previous,
    );

    $items[] = array(
      'class' => 'pager-current',
      'data' => t('@current of @max', array('@current' => $pager_current, '@max' => $pager_max)),
    );

    $items[] = array(
      'class' => 'pager-next',
      'data' => $li_next,
    );
    return theme('item_list', $items, NULL, 'ul', array('class' => 'pager'));
  }
}
luco’s picture

@merlinofchaos I don't know what other tried, but I did exactly that. copied the function theme_views_mini_pager, pasted it in template.php and renamed it to mytheme_views_mini_pager. renamed the links too, of course. it simply didn't work.

and I can't upgrade Zen because I've already got a whole theme based on starterkit (from 6.x-1.1) and who knows what this update would break.

Jon Nunan’s picture

I had this, make sure your template.php file is encoded as UTF-8.

The default template.php in Zen 1.1 was showing up as ANSI encoding in my text editor. This meant when check_plain() was run by l() the '‹‹' encoded in ANSI caused it to return a blank string. Cross posting here because even though this is a Zen problem with l() they symptoms had me checking here first.

Rickdrummer’s picture

Thank you very much! After changing encoding to UTF-8, everything works fine!

dwb17’s picture

Second meatsack solution UTF-8 encoding of template.php, now it is working fine.

camsoft2000’s picture

I can also confirm making sure the template.php file is set to UTF-8 encoding fixes this issue.

OxH2’s picture

just had the same problem and adjusting the document encoding to UTF-8 fixed it right up