Bugzilla – Attachment 4340 Details for
Bug 5453
Variables declaration should not occur in conditionals
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed Patch
0001-Bug-5453-Do-not-declare-variables-in-conditionals.patch (text/plain), 2.74 KB, created by
Colin Campbell
on 2011-06-02 14:51:56 UTC
(
hide
)
Description:
Proposed Patch
Filename:
MIME Type:
Creator:
Colin Campbell
Created:
2011-06-02 14:51:56 UTC
Size:
2.74 KB
patch
obsolete
>From 7e9d41e34d5d96f68d8e9bbfa97efe1b8bcb559b Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Mon, 29 Nov 2010 10:37:15 +0000 >Subject: [PATCH 1/7] Bug 5453 Do not declare variables in conditionals >Content-Type: text/plain; charset="utf-8" > >Removed occurences in acqui/*.pl >--- > acqui/basketgroup.pl | 16 ++++++---------- > acqui/histsearch.pl | 14 ++++++++++---- > 2 files changed, 16 insertions(+), 14 deletions(-) > >diff --git a/acqui/basketgroup.pl b/acqui/basketgroup.pl >index 457b616..08356f8 100755 >--- a/acqui/basketgroup.pl >+++ b/acqui/basketgroup.pl >@@ -305,26 +305,22 @@ if ( $op eq "add" ) { > # Build the combobox to select the billing place > my @billingplaceloop; > for (sort keys %$branches) { >- my $selected = 1 if $_ eq $billingplace; >- my %row = ( >+ push @billingplaceloop, { > value => $_, >- selected => $selected, >+ selected => $_ eq $billingplace, > branchname => $branches->{$_}->{branchname}, >- ); >- push @billingplaceloop, \%row; >+ }; > } > $template->param( billingplaceloop => \@billingplaceloop ); > > # Build the combobox to select the delivery place > my @deliveryplaceloop; > for (sort keys %$branches) { >- my $selected = 1 if $_ eq $deliveryplace; >- my %row = ( >+ push @deliveryplaceloop, { > value => $_, >- selected => $selected, >+ selected => $_ eq $deliveryplace, > branchname => $branches->{$_}->{branchname}, >- ); >- push @deliveryplaceloop, \%row; >+ }; > } > $template->param( deliveryplaceloop => \@deliveryplaceloop ); > >diff --git a/acqui/histsearch.pl b/acqui/histsearch.pl >index 0190e4a..2c41742 100755 >--- a/acqui/histsearch.pl >+++ b/acqui/histsearch.pl >@@ -75,11 +75,17 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > } > ); > >-my $from_iso = C4::Dates->new($input->param('from'))->output('iso') if $input->param('from'); >-my $to_iso = C4::Dates->new($input->param('to'))->output('iso') if $input->param('iso'); >+my ( $from_iso, $to_iso, $d ); >+if ( $d = $input->param('from') ) { >+ $from_iso = C4::Dates->new($d)->output('iso'); >+} >+if ( $d = $input->param('iso') ) { >+ $to_iso = C4::Dates->new($d)->output('iso'); >+} >+ > my ( $order_loop, $total_qty, $total_price, $total_qtyreceived ) = >- &GetHistory( $title, $author, $name, $from_iso, $to_iso ); >- >+ GetHistory( $title, $author, $name, $from_iso, $to_iso ); >+ > $template->param( > suggestions_loop => $order_loop, > total_qty => $total_qty, >-- >1.7.5.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 5453
:
4340
|
4341
|
4342
|
4343
|
4344
|
4345
|
4346
|
4455
|
4456
|
4457
|
4458
|
4459
|
4460
|
4461