From da14b2f4bad75fc4c44c80fb8f21fba38ea3c76f Mon Sep 17 00:00:00 2001 From: Elliott Davis Date: Mon, 19 Mar 2012 16:56:44 -0500 Subject: [PATCH] Bug 5549 : fixed non-cloned date object in Add date for calendar, also removed erounous dumper in moremember.pl that dumped entire issue --- C4/Circulation.pm | 13 ++++++------- Koha/Calendar.pm | 3 ++- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 6a9affadbf..d2aa9b6f02 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -996,12 +996,12 @@ sub AddIssue { # check if we just renew the issue. # if ($actualissue->{borrowernumber} eq $borrower->{'borrowernumber'}) { - $datedue = AddRenewal( - $borrower->{'borrowernumber'}, - $item->{'itemnumber'}, - $branch, - $datedue, - $issuedate, # here interpreted as the renewal date + $datedue = AddRenewal( + $borrower->{'borrowernumber'}, + $item->{'itemnumber'}, + $branch, + $datedue, + $issuedate, # here interpreted as the renewal date ); } else { @@ -1016,7 +1016,6 @@ sub AddIssue { } MoveReserve( $item->{'itemnumber'}, $borrower->{'borrowernumber'}, $cancelreserve ); - # Starting process for transfer job (checking transfert and validate it if we have one) my ($datesent) = GetTransfers($item->{'itemnumber'}); if ($datesent) { diff --git a/Koha/Calendar.pm b/Koha/Calendar.pm index a3ad60c994..1e7299c083 100644 --- a/Koha/Calendar.pm +++ b/Koha/Calendar.pm @@ -83,7 +83,8 @@ sub _init { } sub addDate { - my ( $self, $base_date, $add_duration, $unit ) = @_; + my ( $self, $startdate, $add_duration, $unit ) = @_; + my $base_date = $startdate->clone(); if ( ref $add_duration ne 'DateTime::Duration' ) { $add_duration = DateTime::Duration->new( days => $add_duration ); }