Committer: gprochaev
LJSUP-6613. after visiting gift tab, going back to myself tab doesn't workU trunk/bin/upgrading/en_LJ.dat U trunk/cgi-bin/LJ/Widget/Shop/View/UserHeads.pm
Modified: trunk/bin/upgrading/en_LJ.dat =================================================================== --- trunk/bin/upgrading/en_LJ.dat 2010-08-26 03:59:33 UTC (rev 9399) +++ trunk/bin/upgrading/en_LJ.dat 2010-08-26 04:00:01 UTC (rev 9400) @@ -5224,6 +5224,8 @@ shop.error.diskquota.nothing_selected=You didn't select for how long you want to buy the addon. Please choose one of the options below. +shop.error.userhead.nothing_selected=You didn't select the userhead + shop.error.global.cannot_load_cart=Cannot load cart shop.error.global.not_your_cart=You are trying to view someone other's cart, and you can't do that. Try <a href="/shop/?cart=new">creating a new one</a>. Modified: trunk/cgi-bin/LJ/Widget/Shop/View/UserHeads.pm =================================================================== --- trunk/cgi-bin/LJ/Widget/Shop/View/UserHeads.pm 2010-08-26 03:59:33 UTC (rev 9399) +++ trunk/cgi-bin/LJ/Widget/Shop/View/UserHeads.pm 2010-08-26 04:00:01 UTC (rev 9400) @@ -84,6 +84,8 @@ my ($uh_id) = LJ::Request->post_param('uh') =~ m#uh-(\d+)#; my $uh = LJ::UserHead->get_userhead($uh_id); + $self->raise_errors(LJ::Lang::ml('shop.error.userhead.nothing_selected')) unless $uh; + my $recipient = (LJ::Request->get_param('gift') and LJ::Request->get_param('giftto')) ? LJ::load_user(LJ::Request->get_param('giftto')) @@ -92,13 +94,14 @@ die "Unknown recipient" unless $recipient; my $cart = $self->try_get_cart; + my $remote = LJ::get_remote(); my $it = LJ::Pay::Payment::PayItem::UserHead->new_memonly( subitem => LJ::Request->post_param('uh'), qty => 1, amt => $uh->get_price (), - anon => LJ::get_remote() ? LJ::Request->post_param('gift_anon') : 1, - rcptid => $recipient->userid, + anon => $remote ? LJ::Request->post_param('gift_anon') : 1, + rcptid => LJ::Request->post_param('formyself') eq '1' && $remote ? $remote->userid : $recipient->userid, ); if ($giveafter_yyyy) {