Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Here's the code that I have to add user pictures to comment previews since Drupal core does not add them for some reason.
Comments
Comment #1
Dave ReidHere's the patch that abstracts the logic for presets and comments by using hook_comment('view'). This also fixed a possibly destructive change with the last commit by only replaceing the part of $account->content['user_picture'] we care about in hook_profile_alter().
Comment #2
Dave ReidOne too many comment->picture assignments...
Comment #3
andypostLooks good but does not works with panels.. :(
Comment #4
Dave ReidDid it work before with panels? :) If it's not using the proper theme functions it's kinda hard to support.
Comment #5
andypostWhen viewing comment you need check theme_get_setting('toggle_comment_user_picture')
Comment #6
Dave ReidGood catch! :)
Comment #7
andypostA bit changed logic in preprocess.
I've forget that setup new panels+ctools, so just nedd to restart apache and everything works
Comment #8
Dave ReidWe need to remove the check for isset($comment->uid) and move it two lines down as !empty($comment->uid).
Other modules (like Gravatar) may inject something into $comment->picture for anonymous users but still want imagecache to load its style. This would prevent it.
Powered by Dreditor.
Comment #9
andypostDave, please, test my patch with gravatar.
this isset() is required to not continue if $comment->uid broken
suppose only possible problem if gravater's preprocess runs after ICP
Comment #10
andypostSuppose this is a final patch :)
Comment #11
andypostCommited to D6 - http://drupal.org/cvs?commit=398602
Comment #12
andyposthttp://drupal.org/cvs?commit=398796