From 7c24d12fa871854c9a555c4ad569a7c5539d8ed3 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 --- circ/circulation.pl | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 968470e6f17..205096f008a 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -177,6 +177,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'); @@ -190,20 +204,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.48.1