See subject.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anybody’s picture

Version: 7.x-2.0 » 7.x-2.x-dev

I can confirm the problem still exists in the latest .dev.

Here is further information to fix this issue:

The function that creates this problem can be found in plugins/content_types/author_pane.inc, Linke 27:

/**
 * Output function for the 'author pane' content type.
 */
function author_pane_content_type_render($subtype, $conf, $panel_args, $context) {
  $account = isset($context->data) ? clone $context->data : NULL;
  $block = new stdClass();

  if ($account) {
    // Use the Real Name module if installed. Otherwise just the plain,
    // unthemed user name for the title since we don't want it linked.
    if (module_exists('realname')) {
      $block->title = theme('realname', $account, array('plain' => TRUE));
    }
    else {
      $block->title = check_plain($account->name);
    }
    $variables = array(
      'account' => $account,
      'caller' => $conf['caller'],
      'picture_preset' => $conf['picture_preset'],
      'join_date_type' => $conf['join_date_type'],
    );
    $block->content = theme('author_pane', $variables);
  }
  else {
    $block->content = t('User information not available');
  }

  return $block;
}

The problem behind seems to be that realname does not even implement any theme function called "realname" in the current Drupal 7 version, so this simply seems useless?

Proposed solution:
The correct solution is to remove the realname module check completely and simply use format_username() in a check_plain as described here: https://api.drupal.org/api/drupal/includes!common.inc/function/format_us...
That api function handles everything correctly.

To sum it up this is the corrected function tested and ready for your review:

/**
 * Output function for the 'author pane' content type.
 */
function author_pane_content_type_render($subtype, $conf, $panel_args, $context) {
  $account = isset($context->data) ? clone $context->data : NULL;
  $block = new stdClass();

  if ($account) {
    $block->title = check_plain(format_username($account));
    $variables = array(
      'account' => $account,
      'caller' => $conf['caller'],
      'picture_preset' => $conf['picture_preset'],
      'join_date_type' => $conf['join_date_type'],
    );
    $block->content = theme('author_pane', $variables);
  }
  else {
    $block->content = t('User information not available');
  }

  return $block;
}
Anybody’s picture

Status: Active » Needs review
FileSize
1.7 KB

Patch attached, ready for review.

Anybody’s picture

Please review and let's get this committed. :)

thomas.frobieter’s picture

Thank you! Works great for me. Allright from my side :)