Skip to content

Commit

Permalink
[#264 state:resolved] Patch from SixApart TRAC merged into MT::CMS::A…
Browse files Browse the repository at this point in the history
…sset.
  • Loading branch information
Mike committed Sep 27, 2010
1 parent 6557ca1 commit 8517ae8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/MT/CMS/Asset.pm
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,10 @@ sub asset_userpic {
$asset = $app->model('asset')->lookup($id);
}

my $thumb_html = $app->model('author')->userpic_html( Asset => $asset );

my $user_id = $param->{user_id} || $q->param('user_id');
my $user;
if ($user_id) {
my $user = $app->model('author')->load( {id => $user_id} );
$user = $app->model('author')->load( {id => $user_id} );
if ($user) {
# Delete the author's userpic thumb (if any); it'll be regenerated.
if ($user->userpic_asset_id != $asset->id) {
Expand All @@ -325,6 +324,10 @@ sub asset_userpic {
}
}

my $thumb_html = $user
? $user->userpic_html( Asset => $asset )
: $app->model('author')->userpic_html( Asset => $asset );

$app->load_tmpl(
'dialog/asset_userpic.tmpl',
{
Expand Down

0 comments on commit 8517ae8

Please sign in to comment.