Bug 16527: Restore sticky due date behavior
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Sat, 21 May 2016 08:10:46 +0000 (09:10 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 24 Jun 2016 11:46:35 +0000 (11:46 +0000)
Bug 10067 has introduced a regression on the sticky due date behavior:
If "remember for session" is checked and the due date is changed from 1
checkout to another, the old due date will be used.

The code added by bug 10067 is really confusing and it's hard to say
this patch won't introduce another regression.
The manipulation of $restoreduedatespec, $duedatespec and $stickyduedate
is not easy to follow.

Test plan:
Confirm that the regression is fixed and that this patch will not
introduced a regression on bug 10067 (good luck!)

Signed-off-by: Eivin Giske Skaaren <eivin@sysmystic.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
circ/circulation.pl

index 3057370..bf10bc6 100755 (executable)
@@ -164,7 +164,7 @@ my $stickyduedate  = $query->param('stickyduedate') || $session->param('stickydu
 my $duedatespec    = $query->param('duedatespec')   || $session->param('stickyduedate');
 $duedatespec = eval { output_pref( { dt => dt_from_string( $duedatespec ), dateformat => 'iso' }); }
     if ( $duedatespec );
-my $restoreduedatespec  = $query->param('restoreduedatespec') || $session->param('stickyduedate') || $duedatespec;
+my $restoreduedatespec  = $query->param('restoreduedatespec') || $duedatespec || $session->param('stickyduedate');
 if ( $restoreduedatespec && $restoreduedatespec eq "highholds_empty" ) {
     undef $restoreduedatespec;
 }