Skip to content

Commit

Permalink
[#264 state:resolved] Patch from MT which resolves an issue in which …
Browse files Browse the repository at this point in the history
…userpics were being stored in an undesirable location underneath both the mt-static/support hierarchy and the AssetCacheDir.

Signed-off-by: Jay Allen <jay@endevver.com>
  • Loading branch information
Mike authored and jayallen committed Sep 28, 2010
1 parent c18792b commit 6646c2a
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 6646c2a

Please sign in to comment.