[Koha-patches] [PATCH] Bug 5086 Pass claimed date correctly

Colin Campbell colin.campbell at ptfs-europe.com
Wed Aug 4 13:55:58 CEST 2010


Claim date is being interpolated into sql string but
without the necessary quotes resulting in a date of
0 being set.
interpolation into sql strings should be avoided
---
 C4/Serials.pm |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/C4/Serials.pm b/C4/Serials.pm
index 032246c..8779433 100644
--- a/C4/Serials.pm
+++ b/C4/Serials.pm
@@ -287,7 +287,7 @@ sub UpdateClaimdateIssues {
     my $dbh = C4::Context->dbh;
     $date = strftime( "%Y-%m-%d", localtime ) unless ($date);
     my $query = "
-        UPDATE serial SET claimdate=$date,status=7
+        UPDATE serial SET claimdate=\'$date\',status=7
         WHERE  serialid in (" . join( ",", @$serialids ) . ")";
     my $rq = $dbh->prepare($query);
     $rq->execute;
-- 
1.7.2



More information about the Koha-patches mailing list