Tao themes the views mini pager, but passes incorrect arguments to theme_links.

See:

<?php
$links = array();
  if ($pager_total[$element] > 1) {
    $links['pager-previous'] = theme('pager_previous', array(
      'text' => (isset($tags[1]) ? $tags[1] : t('Prev')),
      'element' => $element,
      'interval' => 1,
      'parameters' => $parameters
    ));
    $links['pager-current'] = array(
      'title' => t('@current of @max', array(
        '@current' => $pager_current,
        '@max' => $pager_max)
      )
    );
    $links['pager-next'] = theme('pager_next', array(
      'text' => (isset($tags[3]) ? $tags[3] : t('Next')),
      'element' => $element,
      'interval' => 1,
      'parameters' => $parameters
    ));
    return theme('links', array('links' => $links, 'attributes' => array('class' => array('links', 'pager', 'views-mini-pager'))));
}
?>

Compared to the one from views:

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

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

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

Tao needs to switch from using theme_links to theme_item_list.

Comments

Taxoman’s picture

Title:Views mini pager theming broken in D7» Views mini pager theming broken in Tao-7.x
DuaelFr’s picture

The tao_pager_link function still returns an unexpected answer.
Why this choice ?

pikku-h’s picture

Also Views Litepager won't render properly when using for example Rubik - which requires Tao. Got it fixed in this issue: https://drupal.org/node/2075009

haydeniv’s picture

Issue summary:View changes
Status:Active» Needs review
StatusFileSize
new2.9 KB

This patch should fix the pager issue.

haydeniv’s picture

Status:Needs review» Needs work

Fixed mini pager but breaks full pager.

annya’s picture

Title:Views mini pager theming broken in Tao-7.x» Views Litepager broken in Tao-7.x
Status:Needs work» Active

As I see problem with mini pager was fixed in Tao-7.x-3.1. I think it was done in this issue https://www.drupal.org/node/1422958

But the problem of compatibility with views_litepager(comment) still exists. I changed title due to this reason.

annya’s picture

Title:Views Litepager broken in Tao-7.x» Custom pager is broken in Tao-7.x
annya’s picture

Status:Active» Needs review
StatusFileSize
new5.68 KB

I investigated this problem and discovered following:

  • All custom pagers that provide own theme-implementation are broken in Tao. I checked this on modules Views Litepager, Views Scroll Pager and Views Simple Pager - all are broken in Tao.
  • The reason of this behavior is function tao_pager_link implementation of theme_pager_link. For some reason tao_pager_link return array(according to documentation in template.php: "Goals: consolidate functionality into less than 5 functions and ensure the markup will not conflict with major other styles (theme_item_list() in particular"), but it should return html-output, because it is a theme-function and theme-functions should always return html.

I create patch to fix this. It work with:

  1. all pagers - both rewritten in Tao's template.php and custom.
  2. with child-themes(I checked it with Rubik)

Please review this patch.

haydeniv’s picture

Status:Needs review» Fixed

Looks fine. Committed to dev.

  • annya authored b3eba5a on 7.x-3.x
    Issue #1367208 by annya, haydeniv | Steven Jones: Fixed Custom pager is...
annya’s picture

Wow that was fast! Thanks!

Status:Fixed» Closed (fixed)

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

m4olivei’s picture

StatusFileSize
new6.48 KB

For anyone needing a patch against 7.x-3.1, attached. Also includes some CSS tweaks that were needed with Rubik theme to avoid core styles for .item-list messing things up.