Bug 7581 - Holds not working in OPAC in singlebranchmode
Summary: Holds not working in OPAC in singlebranchmode
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: 3.6
Hardware: All All
: P3 major
Assignee: Owen Leonard
QA Contact: Ian Walls
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-22 17:09 UTC by Maxime Pelletier
Modified: 2013-12-05 19:59 UTC (History)
3 users (show)

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


Attachments
Singlebranchmode was always 0 causing the branch to be null and the reservations in the OPAC not to work in singlebranchmode. (1.02 KB, patch)
2012-02-22 17:10 UTC, Maxime Pelletier
Details | Diff | Splinter Review
signed-off patch (1.08 KB, patch)
2012-03-20 02:28 UTC, Kristina Hoeppner
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Maxime Pelletier 2012-02-22 17:09:51 UTC
When singlebranchmode is actived users can't place holds. Looks a lot like #3164 which was supposed to be resolved.
Simple patch to follow.
Comment 1 Maxime Pelletier 2012-02-22 17:10:52 UTC Comment hidden (obsolete)
Comment 2 Maxime Pelletier 2012-03-14 21:27:34 UTC
Marking as a bug and and a note that this is sponsored by our client CCSR (http://ccsr.qc.ca).
Comment 3 Kristina Hoeppner 2012-03-19 09:09:28 UTC
I was not able to reproduce the bug on the BibLibre sandboxes 4 and 8. This is what I did:

1. Switched "SingleBranchMode" to "Allow".
2. Went to the Opac side and placed a hold on an item. The status "Pending" was displayed.
3. Switched to the staff client and went to the holds for the book and saw the hold.

No error message. Did I miss a step?
Comment 4 Katrin Fischer 2012-03-19 18:24:41 UTC
Hm, perhaps there is a difference between item level holds and title level holds - but only guessing here. Did you try both?
Comment 5 Kristina Hoeppner 2012-03-19 19:51:52 UTC
I tried both just now on master:
 
1. Make sure that singlebranch mode is allowed.
2. Make sure that I can place holds.
3. Find a book for which I can place a hold on the OPAC side.
4. Place a hold and choose "Next available copy".
5. I can place the hold.
6. Find another book for which I can place a hold, click the "Place Hold" link.
7. Choose "A specific copy" and can place the hold.
8. Do the same as 4 and 7 but choosing a different branch (the one that is not the default).
Comment 6 Maxime Pelletier 2012-03-19 21:01:25 UTC
Sorry, here are more details.
You can see in the code :

if ($singleBranchMode || ! $OPACChooseBranch) { # single branch mode or disabled user choosing

Without my patch, singleBranchMode is always 0, so if OPACAllowUserToChooseBranch is 0, then no branch is ever set and the code doesn't work.

So to reproduce set OPACAllowUserToChooseBranch to "Don't allow". The bug is present when users can't choose the branch and the code use the borrowers's defautl branch.
Comment 7 Chris Cormack 2012-03-19 22:28:43 UTC
Without patch

With singlebranchmode  = Allow
And  OPACAllowUserToChooseBranch = Don't allow  Can still place holds in the opac

With singblebranchmode= Don't Allow
and OPACAllowUserToChooseBranch = Don't allow, Can still place holds

With singlebranch = Don't Allow
and OPACAllowUserToChooseBranch = Allow, Can not place holds (silent fail)
Comment 8 Kristina Hoeppner 2012-03-20 02:28:49 UTC
Created attachment 8324 [details] [review]
signed-off patch

I used Chris' test scenarios as basis for my testing because eventually we had a silent fail. Sorry that I didn't see some things earlier, but code is pretty much a mystery to me. ;-)
Comment 9 Paul Poulain 2012-03-21 17:02:13 UTC
QA comment: tiny patch !
Comment 10 Jared Camins-Esakov 2012-05-09 16:52:51 UTC
This bug will be included in the Koha 3.6.5 release.