Bug 30960: Fix JS error message when no pick-up location is selected when placing...
authorPetro Vashchuk <stalkernoid@gmail.com>
Mon, 13 Jun 2022 12:02:28 +0000 (15:02 +0300)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 20 Jun 2022 13:44:04 +0000 (10:44 -0300)
commit505b62b4d2ff9617733547d41088bdae37b4506d
tree66d1708d77bc3b0b306b0bc71e374245349cd08d
parente32e7a6c9019ac93217f1b4322076e779d35dec4
Bug 30960: Fix JS error message when no pick-up location is selected when placing a hold

It's possible to place item-level hold without selecting a pick-up
location, which causes problems: if the item is then returned,
Koha tells about a hold, but gives error 500.
At patron's hold tab you see the number of holds, but cannot see the
actual holds there. However, if you go to the title in question,
then modify the hold so that it has a pick-up location,
then the hold will work normally again.

This patch fixes already existing but not working JS error message and
ensures that hold cannot be made while pickup location is undefined.

To reproduce:
1. Go to admin page, to the libraries configurations, and disable
pickup location for one of them.
2. Pick any biblio that has items that have that same library as a
default pickup location.
3. When placing the item-level hold, notice that the pickup location
dropdown box is empty by default. Keep it empty, place the hold.
4. Go to the patron's page of the patron who you placed that hold for,
check that it doesn't show the new hold.
5. Apply patch.
6. Repeat steps 2 and 3, it shouldn't let you make the item-level hold
until you select a specific pickup location.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
reserve/placerequest.pl