[Koha-patches] [PATCH] bug 2505: enabled warnings in C4::NewsChannels

Chris Cormack chrisc at catalyst.net.nz
Mon Jun 8 00:02:43 CEST 2009


From: Galen Charlton <galen.charlton at liblime.com>

Signed-off-by: Chris Cormack <chrisc at catalyst.net.nz>
---
 C4/NewsChannels.pm |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/C4/NewsChannels.pm b/C4/NewsChannels.pm
index 8cf1ff6..59ab124 100644
--- a/C4/NewsChannels.pm
+++ b/C4/NewsChannels.pm
@@ -18,6 +18,7 @@ package C4::NewsChannels;
 # Suite 330, Boston, MA  02111-1307 USA
 
 use strict;
+use warnings;
 
 use C4::Context;
 use C4::Dates qw(format_date);
@@ -279,7 +280,7 @@ sub get_opac_new {
     my $sth = $dbh->prepare("SELECT * FROM opac_news WHERE idnew = ?");
     $sth->execute($idnew);
     my $data = $sth->fetchrow_hashref;
-    $data->{$data->{'lang'}} = 1;
+    $data->{$data->{'lang'}} = 1 if defined $data->{lang};
     $data->{expirationdate} = format_date($data->{expirationdate});
     $data->{timestamp}      = format_date($data->{timestamp});
     $sth->finish;
-- 
1.5.6.3




More information about the Koha-patches mailing list