Bug 10166 - Can't place holds on multiple titles if one or more are un-holdable
Summary: Can't place holds on multiple titles if one or more are un-holdable
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: 3.10
Hardware: All All
: P5 - low major
Assignee: Owen Leonard
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-01 16:22 UTC by Owen Leonard
Modified: 2014-12-07 20:02 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Screenshot showing all holds blocked because 2 out of 3 are un-holdable (16.15 KB, image/png)
2013-05-01 16:22 UTC, Owen Leonard
Details
Bug 10166 - Can't place holds on multiple titles if one or more are un-holdable (2.96 KB, patch)
2013-05-01 18:59 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 10166 - Can't place holds on multiple titles if one or more are un-holdable (2.97 KB, patch)
2013-05-03 17:01 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
[PASSED QA] Bug 10166 - Can't place holds on multiple titles if one or more are un-holdable (3.07 KB, patch)
2013-05-04 13:26 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 10166 [3.10.x] Can't place holds on multiple titles if one or more are un-holdable (2.71 KB, patch)
2013-05-16 12:52 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 10166 [3.10.x] Can't place holds on multiple titles if one or more are un-holdable (2.72 KB, patch)
2013-05-24 21:10 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 10166 [3.10.x] Can't place holds on multiple titles if one or more are un-holdable (2.78 KB, patch)
2013-06-14 11:58 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2013-05-01 16:22:19 UTC
Created attachment 17872 [details]
Screenshot showing all holds blocked because 2 out of 3 are un-holdable

When placing holds on multiple titles in the OPAC the entire operation is blocked if any one of those multiple titles cannot be placed on hold.
Comment 1 Owen Leonard 2013-05-01 18:59:49 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall (khall) 2013-05-03 17:01:26 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2013-05-04 13:26:29 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2013-05-04 13:31:01 UTC
I have run through the test plan before and after applying the patch. I couldn't reproduce the problem, but I also can't find any problems with the patch.
Leaving this for Jared as I think he was involved in solving the problem.
Comment 5 Owen Leonard 2013-05-04 13:40:04 UTC
Sorry if I didn't provide enough information to reproduce the problem. The screenshot helps explain: If the last item in the list of multiple titles to hold is unavailable it prevents all from being placed on hold. The problem doesn't exist if the last item in the list *is* available to be placed on hold.

To reproduce you have to make sure the last title you check in the search results list is not available to be placed on hold.
Comment 6 Katrin Fischer 2013-05-06 10:02:26 UTC
Hi Owen, maybe I got a bit lot between records and items here - does it mean the last item on the record or the last entry in the list of records? I think I tried both and it worked, but I could try to reproduce again.
Comment 7 Jared Camins-Esakov 2013-05-06 12:40:00 UTC
This patch has been pushed to master and 3.12.x.

I did a small follow-up which I am pretty sure will be necessary when someone addresses the maxholds issue.
Comment 8 Chris Cormack 2013-05-12 03:07:37 UTC
Does not apply to 3.10.x please send a new patch if it is needed for 3.10.x
Comment 9 Owen Leonard 2013-05-16 12:52:36 UTC Comment hidden (obsolete)
Comment 10 Chris Cormack 2013-05-24 21:10:03 UTC Comment hidden (obsolete)
Comment 11 Jonathan Druart 2013-06-14 11:58:29 UTC
The last patch fixes the issue for the 3.10.x branch.
Maybe the Jared's patch should be retrieved too:

commit 5c9522382c83f078692051fa572c56b21b54fa77
Author:     Jared Camins-Esakov <jcamins@cpbibliography.com>
AuthorDate: Mon May 6 08:35:00 2013 -0400
Commit:     Jared Camins-Esakov <jcamins@cpbibliography.com>
CommitDate: Mon May 6 08:38:09 2013 -0400

    Bug 10166: Increment holdable counter


Marked as Passed QA.
Comment 12 Jonathan Druart 2013-06-14 11:58:50 UTC
Created attachment 18989 [details] [review]
Bug 10166 [3.10.x] Can't place holds on multiple titles if one or more are un-holdable

opac-reserve.pl tries to check whether all selected titles in a
multiple-hold batch are unavailable to be placed on hold. However, the
logic is flawed in such a way that if the last item in the batch cannot
be placed on hold the script assumes none can be placed on hold.

This patch modifies the way the script tracks the "no titles available
for holds" variable in order to correct the error.

To test, place multiple holds by selecting titles from a list of search
results. Test three conditions:

- All titles are available to be placed on hold

  You should see no onscreen warnings, and all titles should be
  selectable on the place hold screen. A "Place hold" button should
  appear at the bottom.

- Some titles can be placed on hold, some cannot

  The titles which can be placed on hold should be selectable.
  Titles which cannot be placed on hold should show a warning
  message. A "Place hold" button should appear at the bottom.

- No titles can be placed on hold

  "Sorry, none of these items can be placed on hold." should appear at
  the top of the page. All titles should appear with warning messages.
  There should be no "Place hold" button.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 13 Bernardo Gonzalez Kriegel 2013-06-14 19:33:37 UTC
Pushed to 3.10.x, will be in 3.10.7

Thanks Owen and thanks Chris for the tip.
Comment 14 Chris Hall 2013-06-17 08:48:05 UTC
Pushed to 3.8.x, will be in 3.8.14