[Koha-patches] [PATCH] [labels_recon] Fixing some warnings, no functionality changes

Chris Cormack chrisc at catalyst.net.nz
Thu Sep 3 02:11:47 CEST 2009


---
 C4/Labels/Profile.pm        |   13 ++++++++-----
 labels/label-item-search.pl |    2 +-
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/C4/Labels/Profile.pm b/C4/Labels/Profile.pm
index f5b2419..59d0c4b 100644
--- a/C4/Labels/Profile.pm
+++ b/C4/Labels/Profile.pm
@@ -45,11 +45,14 @@ sub _check_params {
 
 sub _conv_points {
     my $self = shift;
-    my @unit_value = grep {$_->{'type'} eq $self->{units}} @{get_unit_values()};
-    $self->{offset_horz}        = $self->{offset_horz} * $unit_value[0]->{'value'};
-    $self->{offset_vert}        = $self->{offset_vert} * $unit_value[0]->{'value'};
-    $self->{creep_horz}         = $self->{creep_horz} * $unit_value[0]->{'value'};
-    $self->{creep_vert}         = $self->{creep_vert} * $unit_value[0]->{'value'};
+  
+   if ($self->{units}){
+        my @unit_value = grep {$_->{'type'} eq $self->{units}} @{get_unit_values()};
+        $self->{offset_horz}        = $self->{offset_horz} * $unit_value[0]->{'value'};
+        $self->{offset_vert}        = $self->{offset_vert} * $unit_value[0]->{'value'};
+        $self->{creep_horz}         = $self->{creep_horz} * $unit_value[0]->{'value'};
+        $self->{creep_vert}         = $self->{creep_vert} * $unit_value[0]->{'value'};
+    }  
     return $self;
 }
 
diff --git a/labels/label-item-search.pl b/labels/label-item-search.pl
index 8f950ec..a8a56ac 100755
--- a/labels/label-item-search.pl
+++ b/labels/label-item-search.pl
@@ -48,7 +48,7 @@ BEGIN {
 my $query = new CGI;
 
 my $type      = $query->param('type');
-my $op        = $query->param('op');
+my $op        = $query->param('op') || '';
 my $batch_id  = $query->param('batch_id');
 my $ccl_query = $query->param('ccl_query');
 my $startfrom = $query->param('startfrom') || 1;
-- 
1.6.0.4




More information about the Koha-patches mailing list