Committer: ailyin
LJSUP-6426 (LJTIMES server side): address 'Error creating gpic: Can't use an undefined value as a HASH reference at /home/lj/fb/lib/FB/Gpic.pm line 667'; fix the root cause of that before removing the double upload workaroundU trunk/lib/FB/Gpic.pm U trunk/lib/FB/Protocol/UploadPic.pm
Modified: trunk/lib/FB/Gpic.pm =================================================================== --- trunk/lib/FB/Gpic.pm 2010-08-10 07:08:08 UTC (rev 1429) +++ trunk/lib/FB/Gpic.pm 2010-08-30 04:10:20 UTC (rev 1430) @@ -664,9 +664,15 @@ { my $content = $self->data; my $error = 0; + + my $remote = $opts{'remote'} || FB::get_remote(); + my $username; + $username = $remote->{'user'} if $remote; + LJ::run_hooks('check_img_content', \$error, $$content, { - username => FB::get_remote()->{'user'}, + username => $username, }); + croak "Error: The image you attempted to upload could not be processed.\n" if $error; } Modified: trunk/lib/FB/Protocol/UploadPic.pm =================================================================== --- trunk/lib/FB/Protocol/UploadPic.pm 2010-08-10 07:08:08 UTC (rev 1429) +++ trunk/lib/FB/Protocol/UploadPic.pm 2010-08-30 04:10:20 UTC (rev 1430) @@ -458,7 +458,7 @@ # them a key and makes them permanent # 3) in case of mogilefs uploads via receipt, this only saves # gpic row since mogilefs file already has a key (was renamed above) - eval { $gpic->save }; + eval { $gpic->save('remote' => $u) }; return $err_discard->(510 => $@) if $@; }