From aae56e21aa18442450a94c5ba1168310ce0c8d58 Mon Sep 17 00:00:00 2001 From: Ryan Higgins Date: Wed, 1 Jul 2009 20:37:42 -0500 Subject: [PATCH] Bug 2770 follwup : force AddRenewal obey circControl system preference [revised] Also prevents infinite-length renewals by returning undef if passed an invalid date instead of renewing with no due date. Signed-off-by: Galen Charlton Signed-off-by: Henri-Damien LAURENT --- C4/Circulation.pm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index f489fa8a3a..bfbb6221b9 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1957,14 +1957,11 @@ from the book's item type. sub AddRenewal { my $borrowernumber = shift or return undef; my $itemnumber = shift or return undef; - my $branch = shift; + my $branch = (@_) ? shift : $item->{homebranch}; # opac-renew doesn't send branch my $datedue = shift; my $lastreneweddate = shift || C4::Dates->new()->output('iso'); my $item = GetItem($itemnumber) or return undef; my $biblio = GetBiblioFromItemNumber($itemnumber) or return undef; - my $branch = (@_) ? shift : $item->{homebranch}; # opac-renew doesn't send branch - my $datedue = shift; - my $lastreneweddate = shift; # If the due date wasn't specified, calculate it by adding the # book's loan length to today's date. -- 2.39.5