For some time, the user images (only in advanced forum) link to /files/imagecache/advf-author-pane/avatars/picture-1.gif, but they are shown blank, as imagecache does not create the images. I have not set an imagecache profile to use, but even enabling it does not change anything.

I also could not figure out who has redirected this, but now all user images are shown blank, so this is a bit critical. If I can be of further help for research, please let me know.

CommentFileSizeAuthor
#2 advanced_forum.imagecachepreset.patch10.64 KBaaron

Comments

michelle’s picture

Category: bug » support
Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

I've been away from the queue for a while. Have you figured this out?

If you don't have a preset, that bit of code to use imagecache doesn't run so I'm at a loss as to what the problem could be. If it's still a problem, let me know and I'll give you some debug code to try.

Michelle

aaron’s picture

Category: support » bug
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new10.64 KB

that happens for me as well.

looks like in two places, you have:

  $variables['author_pane'] = theme('author_pane', $variables['account'], advanced_forum_path_to_images(), 'advf-author-pane');

Setting that to

  $variables['author_pane'] = theme('author_pane', $variables['account'], advanced_forum_path_to_images(),variable_get('advanced_forum_user_picture_preset', ''));

resolves the issue.

patch attached.

michelle’s picture

Category: bug » support
Status: Needs review » Active

@aaron: Thanks for trying but that patch makes no sense. The original theme function call is correct. You don't pass in the imagecache preset name into the template name parameter. The only way that could possibly work is if, by sheer coincidence, you called your imagecache preset the same thing as the template name.

Michelle

aaron’s picture

Category: support » bug
Status: Active » Needs review

Let's trace the code, then.

As the module is currently written:

theme('author_pane', $variables['account'], advanced_forum_path_to_images(), 'advf-author-pane');

This calls theme_author_pane(), which calls template_preprocess_author_pane(&$variables), with the third variable of $picture_preset being set to 'advf-author-pane'. In that function, we see:

  $preset = (!empty($variables['picture_preset'])) ? $variables['picture_preset'] : '';
  $variables['picture'] = theme('author_pane_user_picture', $variables['account'], $caller, $preset);

This sets $preset to 'advf-author-pane'. Then it calls theme_author_pane_user_picture(), again setting the $picture_preset to $preset. There, again, we see

$preset = (!empty($variables['picture_preset'])) ? $variables['picture_preset'] : '';

which sets its local $preset to 'advf-author-pane'. Later, it calls

  $picture = (!empty($preset) && module_exists('imagecache')) ? $account->picture : file_create_url($account->picture);

which rightfully sets $picture to our $account->picture (not creating the url yet, as we want to go through imagecache). Then we see

    if (!empty($preset) && module_exists('imagecache')) {
        // Toss the picture over to imagecache for sizing
        $variables['picture'] = theme('imagecache', $preset, $picture);
      }

Which now calls, in effect, theme('imagecache', 'advf-author-pane', $account->picture). Which, unless you've by chance created an imagecache preset named 'advf-author-pane', returns a meaningless url.

The patch at #2 still stands, and corrects the problem.

aaron’s picture

For clarification, look at:

/**
 * Implementation of hook_theme().
 */
function author_pane_theme() {
  author_pane_include('author-pane.inc');
  $items['author_pane'] = array(
      'template' => 'author-pane',
      'arguments' => array(
        'account' => NULL,
        'caller' => NULL,
        'picture_preset' => NULL,
      )
  );

  $items['author_pane_user_picture'] = array(
      'template' => 'author-pane-user-picture',
      'arguments' => array(
        'account' => NULL,
        'caller' => NULL,
        'picture_preset' => NULL,
      )
  );

  return $items;
}

You mentioned a 'template name parameter', which I don't see. Perhaps that's in another version of the module, but something got changed?

michelle’s picture

Category: bug » support
Status: Needs review » Closed (won't fix)

Ah, I see the problem. You're using the wrong version of Author Pane. AF 1.x needs AP 1.x. AP 2.x is still in development and is meant to be used with AF 2.x.

Michelle

jahwe2000’s picture

ah, the 2.x version slipped through in the plugin manager and caused all this... thank you for tracking this down, now it works again :)

michelle’s picture

Ah, yeah, that would do it. It's easy to slip. I accidentally installed views 3 twice on my site. Luckily there's no database changes so I could downgrade. :)

Michelle