Bugzilla – Attachment 100216 Details for
Bug 24802
Updating holds can cause suspensions to apply to wrong hold
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24802: Updating holds can cause suspensions to apply to wrong hold
Bug-24802-Updating-holds-can-cause-suspensions-to-.patch (text/plain), 4.38 KB, created by
Marcel de Rooy
on 2020-03-06 08:34:24 UTC
(
hide
)
Description:
Bug 24802: Updating holds can cause suspensions to apply to wrong hold
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2020-03-06 08:34:24 UTC
Size:
4.38 KB
patch
obsolete
>From feb08297ab8264160a7bb1eafb44e46128845647 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 4 Mar 2020 12:08:29 -0500 >Subject: [PATCH] Bug 24802: Updating holds can cause suspensions to apply to > wrong hold >Content-Type: text/plain; charset=utf-8 > >On request.pl, the table of holds shows a suspend_until date picker for each hold, *unless* that hold is waiting or in transit. The script reserve/modrequest.pl assumes that there will be a suspend_until input for each hold, but that is incorrect. Assume there are 20 holds on a record, and 10 of them are waiting or in transit. If you were to then set the suspend until date on the 10 open holds, and use the "Update hold(s)" button, those 10 suspensions would apply to the 10 found holds and not the holds they should apply to! > >Test Plan: >1) Place two holds on a record >2) Check in an item and trap it for the first hold >3) Now that one hold is waiting and the other is not, attempt to set > a suspension date using the "Update hold(s)" button >4) Note your hold does not get suspended! >5) Apply this patch >6) Restart all the things! >7) Repeat steps 1-3 >8) Your hold should now be suspended! > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc | 4 ++-- > reserve/modrequest.pl | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >index bb3cf7ce30..919ccdd9f8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >@@ -201,10 +201,10 @@ > > [% IF Koha.Preference('AutoResumeSuspendedHolds') %] > <label for="suspend_until_[% hold.reserve_id | html %]">[% IF ( hold.suspend ) %] on [% ELSE %] until [% END %]</label> >- <input type="text" name="suspend_until" id="suspend_until_[% hold.reserve_id | html %]" size="10" value="[% hold.suspend_until | $KohaDates %]" class="datepicker suspend_until_datepicker" /> >+ <input type="text" name="suspend_until_[% hold.reserve_id | html %]" id="suspend_until_[% hold.reserve_id | html %]" size="10" value="[% hold.suspend_until | $KohaDates %]" class="datepicker suspend_until_datepicker" /> > <a href='#' onclick="document.getElementById('suspend_until_[% hold.reserve_id | html %]').value='';">Clear date</a> > [% ELSE %] >- <input type="hidden" name="suspend_until" id="suspend_until_[% hold.reserve_id | html %]" value=""/> >+ <input type="hidden" name="suspend_until_[% hold.reserve_id | html %]" id="suspend_until_[% hold.reserve_id | html %]" value=""/> > [% END %] > [% END %] > [% END # IF SuspendHoldsIntranet %] >diff --git a/reserve/modrequest.pl b/reserve/modrequest.pl >index e75fac73ac..40c390297f 100755 >--- a/reserve/modrequest.pl >+++ b/reserve/modrequest.pl >@@ -49,7 +49,6 @@ my @reservedates = $query->multi_param('reservedate'); > my @expirationdates = $query->multi_param('expirationdate'); > my @branch = $query->multi_param('pickup'); > my @itemnumber = $query->multi_param('itemnumber'); >-my @suspend_until=$query->multi_param('suspend_until'); > my $multi_hold = $query->param('multi_hold'); > my $biblionumbers = $query->param('biblionumbers'); > my $count=@rank; >@@ -70,13 +69,14 @@ if ($CancelBorrowerNumber) { > else { > for (my $i=0;$i<$count;$i++){ > undef $itemnumber[$i] if !$itemnumber[$i]; >+ my $suspend_until = $query->param( "suspend_until_" . $reserve_id[$i] ); > my $params = { > rank => $rank[$i], > reserve_id => $reserve_id[$i], > expirationdate => $expirationdates[$i] ? dt_from_string($expirationdates[$i]) : undef, > branchcode => $branch[$i], > itemnumber => $itemnumber[$i], >- suspend_until => $suspend_until[$i] >+ defined $suspend_until ? ( suspend_until => $suspend_until ) : (), > }; > if (C4::Context->preference('AllowHoldDateInFuture')) { > $params->{reservedate} = $reservedates[$i] ? dt_from_string($reservedates[$i]) : undef; >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24802
:
100141
|
100155
| 100216 |
102811