Bug 29349: Do not assume holding branch is a valid pickup location
authorTomas Cohen Arazi <tomascohen@theke.io>
Fri, 3 Dec 2021 19:45:21 +0000 (16:45 -0300)
committerAndrew Fuerste-Henry <andrew@bywatersolutions.com>
Fri, 17 Dec 2021 21:08:58 +0000 (21:08 +0000)
commit4ac0d3247207bb963bc84b807aee0af0cf60865f
treef81656edb16e1a9c2313bc81fe0e757b79f506d5
parent7a335a2e3ca3f551b5792d8ac3f23d6dff533d80
Bug 29349: Do not assume holding branch is a valid pickup location

The original code for pickup locations when placing item-level holds
picked the currently logged-in library.

We made things more robust, as the logged-in library might not be a
valid pickup location for the patron and item. But it was wrongly chosen
to use the holding branch as the default.

A more robust approach is needed, and this precedence is picked this
time (it could be configuration-driven in the future):

    - Logged-in library
    - Empty

To test:
1. Pick a biblio with various valid pickup locations, some not including
   the logged-in library.
2. Pick a patron for placing the hold
=> FAIL: Notice that (when valid pickup location) the holding branch is
always chosen
3. Apply this patch
4. Repeat 2
=> SUCCESS: If valid pickup location, the logged-in branch is picked as
default for item-type level. When it is not, an empty dropdown is used
as a fallback.
5. Sign off :-D

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit ed5f739cd6e4fb1ebf0c707856725df33ccc5320)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
reserve/request.pl