This issue arose as I have a block that appears on every page with the title of this block being a link to a single page (node/7). The block in question also appears on this page (node/7).

Within the function "block_titlelink_preprocess_block" a call is made to the function "l" (includes/common.inc - "Formats an internal or external URL link as an HTML anchor tag."). When we get to the line to append the active class (2313 in my case), the function is expecting the class attribute variable to be an array, instead this module is passing a string. The fix is as bellow where I have commented out the incorrect line.

I hope this helps someone

Rob

/**
 * Implementation of hook_preprocess_block
**/
function block_titlelink_preprocess_block(&$vars, $hook) {
  if ($hook == 'block') {
    $vars['block']->title_link = _block_titlelink_get_link($vars['block']);
    $title_link = $vars['block']->title_link;
    if ($title_link != '') {
      //$vars['block']->subject = l($vars['block']->subject, $title_link, array('attributes' => array('class' => 'block-title-link'), 'html'=>'true'));
      $vars['block']->subject = l($vars['block']->subject, $title_link, array('attributes' => array('class' => array('block-title-link')), 'html'=>'true'));
    }
  }
}

Comments

phenaproxima’s picture

I was getting a WSOD as a result of this bug. Your fix worked perfectly for me. Thank you!

ngmaloney’s picture

Assigned: Unassigned » ngmaloney
Status: Active » Closed (fixed)

Latest dev snapshot has resolved this issue. The $attributes variable in the snippet below contains the array:

      if (!empty($vars['block']->title_link) && $display) {
        $attributes = array(
          'attributes' => array(
            'class' => array('block-title-link'),
          ),
          'html' => TRUE,
        );
        if(!empty($vars['block']->title_link_title)) {
          $attributes['attributes']['title'] = $vars['block']->title_link_title;
        }
        $vars['block']->subject = l(t($vars['block']->subject), t($vars['block']->title_link), $attributes);