http://bugs.dwscoalition.org/show_bug.cgi?id=4230
authorfu
Fri Jan 27 13:51:52 2012 +0800
changeset 4239555a213bdacc
parent 4238 049c2c2b3a80
child 4240 5bab31c9f015
http://bugs.dwscoalition.org/show_bug.cgi?id=4230

Fix all the bad my $var = ... if ... constructions.

Patch by sophie.
cgi-bin/DW/Controller/RPC/CutExpander.pm
htdocs/admin/invites/codetrace.bml
htdocs/support/see_request.bml
     1.1 --- a/cgi-bin/DW/Controller/RPC/CutExpander.pm	Fri Jan 27 13:46:00 2012 +0800
     1.2 +++ b/cgi-bin/DW/Controller/RPC/CutExpander.pm	Fri Jan 27 13:51:52 2012 +0800
     1.3 @@ -45,7 +45,7 @@
     1.4          # all parameters are included; get the entry.
     1.5          my $ditemid = $args->{ditemid};
     1.6          my $uid = LJ::get_userid( $args->{journal} );
     1.7 -        my $entry = LJ::Entry->new( $uid, ditemid => $ditemid ) if $uid;
     1.8 +        my $entry = $uid ? LJ::Entry->new( $uid, ditemid => $ditemid ) : undef;
     1.9  
    1.10          # FIXME: This returns 200 due to old library, Make return proper when we are jQuery only.
    1.11          return $error_out->( 200, BML::ml( "error.nopermission" ) ) unless $entry;
     2.1 --- a/htdocs/admin/invites/codetrace.bml	Fri Jan 27 13:46:00 2012 +0800
     2.2 +++ b/htdocs/admin/invites/codetrace.bml	Fri Jan 27 13:51:52 2012 +0800
     2.3 @@ -59,7 +59,7 @@
     2.4  
     2.5      foreach my $code ( @codes ) {
     2.6          my $owner = $code->owner == $account->id ? $account : LJ::load_userid( $code->owner );
     2.7 -        my $recipient = LJ::load_userid( $code->recipient ) if $code->is_used;
     2.8 +        my $recipient = $code->is_used ? LJ::load_userid( $code->recipient ) : undef;
     2.9          $ret .= "<tr>";
    2.10          $ret .= "<td><tt>" . $code->code . "</tt></td>";
    2.11          $ret .= "<td>" . ( $owner ? $owner->ljuser_display : "" ) . "</td>";
     3.1 --- a/htdocs/support/see_request.bml	Fri Jan 27 13:46:00 2012 +0800
     3.2 +++ b/htdocs/support/see_request.bml	Fri Jan 27 13:51:52 2012 +0800
     3.3 @@ -205,9 +205,9 @@
     3.4          if ($foundspid) {
     3.5              return BML::redirect("see_request?id=$foundspid");
     3.6          } else {
     3.7 -            my $goback = BML::ml('.goback.text', {request_link=>"href='see_request?id=$spid'", spid=>$spid}) if $sp;
     3.8 +            my $goback = $sp ? BML::ml('.goback.text', {request_link=>"href='see_request?id=$spid'", spid=>$spid}) : undef;
     3.9              my $what = $find eq 'next' || $find eq 'cnext' ? $ML{'.next'} : $ML{'.previous'};
    3.10 -            my $cat = $ML{'.incat'}  if $find eq 'cnext' || $find eq 'cprev';
    3.11 +            my $cat = $find eq 'cnext' || $find eq 'cprev' ? $ML{'.incat'} : undef;
    3.12              return "<?h1 $ML{'.error'} h1?>".BML::ml('.error.text2', {what=>$what, cat=>$cat})." $goback";
    3.13          }
    3.14      }