On the admin content page (/admin/content/node) I get the following error (Drupal 7.10):

Recoverable fatal error: Argument 3 passed to l() must be an array, string given, called in /[...]/includes/theme.inc on line 1599 and defined in l() (Zeile 2307 von /[...]/includes/common.inc).

I have located that the error comes from the rubik template.php and the function tao_pager(). More precisely, in the lines 277 and 303-306.

The problem seems to be, that an array is expected, but an rendered HTML string is given. If the core theme_link() function handles this and would generate a link (because $link['href'] is not empty, it is a string with the value "<"), it runs into the problem.

Comments

cbeier’s picture

Project: Rubik » Tao
Version: 7.x-4.x-dev » 7.x-3.0-beta4
wbobeirne’s picture

Status: Active » Postponed (maintainer needs more info)

I couldn't seem to replicate this issue, despite the pager showing. Is there any more information you could provide about how you're encountering this issue, or other possible variables in your page?

cbeier’s picture

Status: Postponed (maintainer needs more info) » Active

So, I was able to isolate the problem more closely. The problem is related to the contrib module "Clean Pagination" (http://drupal.org/project/cleanpager). More precisely, this function (cleanpager.module #111):

/**
 * Override theme for a pager link
 */
function cleanpager_theme_pager_link($variables) {
  $text = $variables['text'];
  $page_new = $variables['page_new'];
  $element = $variables['element'];
  $parameters = $variables['parameters'];
  $attributes = $variables['attributes'];

  $page = isset($_GET['page']) ? $_GET['page'] : '';
  if ($new_page = implode(',', pager_load_array($page_new[$element], $element, explode(',', $page)))) {
    $parameters['page'] = $new_page;
  }

  $query = array();
  if (count($parameters)) {
    $query = drupal_get_query_parameters($parameters, array());
  }
  if ($query_pager = pager_get_query_parameters()) {
    $query = array_merge($query, $query_pager);
  }

  // Set each pager link title
  if (!isset($attributes['title'])) {
    static $titles = NULL;
    if (!isset($titles)) {
      $titles = array(
        t('« first') => t('Go to first page'),
        t('‹ previous') => t('Go to previous page'),
        t('next ›') => t('Go to next page'),
        t('last »') => t('Go to last page'),
      );
    }
    if (isset($titles[$text])) {
      $attributes['title'] = $titles[$text];
    }
    elseif (is_numeric($text)) {
      $attributes['title'] = t('Go to page @number', array('@number' => $text));
    }
  }

  return l($text, $_GET['q'], array('attributes' => $attributes, 'query' => $query));
}

Tao uses even the same theme hook, and generates an array instead of a string. However, I do not know who is really responsible for this problem (Tao or Clean Pagination).

Update: Because the theme_pager_link is on several locations implemented (tao's template.php and cleanpager.module), only one function is called. In my case, only the function cleanpager_theme_pager_link() is called. The function tao_theme_pager_link() is not called. And so, not the (later) expected array is returned.

barraponto’s picture

Project: Tao » Clean Pagination
Version: 7.x-3.0-beta4 » 7.x-1.x-dev
Category: bug » support

Clean Pagination provides its own theme function override, but themes have always been allowed to override module implementations. This is a won't fix for Tao just as it would be for any other base theme — only exception I know of is theme_blocks clash in Zen / Context.

I'd hope that Clean Pagination (optionally) warns its users whether the theme functions are being overridden by the theme. Users can either remove the theme override from their theme or, if override happens in base theme, copy Clean Pagination overrides to their theme, changing name accordingly.

Of course, both theme functions could be merged by a skilled themer, but it shouldn't be provided by the base theme, but by the theme (or optionally by Clean Pagination, if mantainers see fit).

j_ten_man’s picture

Status: Active » Closed (duplicate)