From 7f60d887976972aafe16e1495ff46cee128ea81f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joonas=20Kylm=C3=A4l=C3=A4?= Date: Sun, 19 Jun 2022 10:22:39 +0000 Subject: [PATCH] Bug 30947: (follow-up) Remove unnecessary object cloning MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit CalcDateDue() works on its own copy of the $startdate parameter so the cloning in the calling end is not necessary. Signed-off-by: Joonas Kylmälä Signed-off-by: Tomas Cohen Arazi --- C4/Circulation.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 27ba1ee06c..73f2e5aa77 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -796,7 +796,7 @@ sub CanBookBeIssued { my $circ_library = Koha::Libraries->find( _GetCircControlBranch($item_unblessed, $patron_unblessed) ); my $now = dt_from_string(); - $duedate ||= CalcDateDue( $now->clone(), $effective_itemtype, $circ_library->branchcode, $patron_unblessed ); + $duedate ||= CalcDateDue( $now, $effective_itemtype, $circ_library->branchcode, $patron_unblessed ); if (DateTime->compare($duedate,$now) == -1 ) { # duedate cannot be before now $needsconfirmation{INVALID_DATE} = output_pref($duedate); } -- 2.39.5