From 19ea16fadeccb9aa57d0e29c20e64fd7f80c97e2 Mon Sep 17 00:00:00 2001 From: David Gustafsson Date: Thu, 6 Mar 2025 18:45:35 +0100 Subject: [PATCH] Bug 39267: Specified due date remains for checkouts even when removing unchecking remember for session To test: 1) Checkout an item for a patron, specify a due date and check remember for session. 2) Remove the due date, uncheck remember for session and checkout another item. 3) The previously specified due date is filled in again, while remember for session remains unchecked. 4) Apply patch 5) Repeat the steps above, in step 3) due date should now remain empty. Sponsored-by: Gothenburg University Libarary Signed-off-by: Gretchen --- circ/circulation.pl | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index dddd2a1f5f..d02daf8d4f 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -178,6 +178,20 @@ for my $barcode (@$barcodes) { $barcode = barcodedecode($barcode) if $barcode; } +# Check if stickyduedate is turned off +if (@$barcodes) { + + # was stickyduedate loaded from session? + if ( $session->param('stickyduedate') && !$query->param("stickyduedate") ) { + $session->clear('stickyduedate'); + } + + $session->param( 'auto_renew', scalar $query->param('auto_renew') ); + +} else { + $session->clear('auto_renew'); +} + my $stickyduedate = $query->param('stickyduedate') || $session->param('stickyduedate'); my $duedatespec = $query->param('duedatespec') || $session->param('stickyduedate'); my $restoreduedatespec = $query->param('restoreduedatespec') || $duedatespec || $session->param('stickyduedate'); @@ -191,20 +205,6 @@ my $recall_id = $query->param('recall_id'); my $debt_confirmed = $query->param('debt_confirmed') || 0; # Don't show the debt error dialog twice my $charges = $query->param('charges') || q{}; -# Check if stickyduedate is turned off -if (@$barcodes) { - - # was stickyduedate loaded from session? - if ( $stickyduedate && !$query->param("stickyduedate") ) { - $session->clear('stickyduedate'); - $stickyduedate = $query->param('stickyduedate'); - $duedatespec = $query->param('duedatespec'); - } - $session->param( 'auto_renew', scalar $query->param('auto_renew') ); -} else { - $session->clear('auto_renew'); -} - $template->param( auto_renew => $session->param('auto_renew') ); my ( $datedue, $invalidduedate ); -- 2.39.5