Bug 30693: Javascript broken on request.pl
authorOwen Leonard <oleonard@myacpl.org>
Thu, 5 May 2022 14:21:19 +0000 (14:21 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 5 May 2022 15:10:38 +0000 (16:10 +0100)
commitf6a0eb3a2a201c9ddb07b626653563faebe4434d
treeb6c970a92812710176d5fb20fe000b8ca2559431
parent63d324db28f0cdcbacddb21a2e1ff1aada1f939e
Bug 30693: Javascript broken on request.pl

The holds page in the staff interface has some JavaScript relating to
Bootstrap tabs, but the tabs are not always present on the page. This
leads to a JS error after you have selected the patron for the hold.

This patch adds a check for the tabs container element before executing
the code.

To test, apply the patch and locate a bibliographic record on which to
place a hold.

- On the initial holds screen should see tabs for "Patrons" and "Clubs."
  Both should work correctly.
- Select a patron to place the hold for.
- On the page where you enter hold details (pickup library, hold
  expiration, etc.) there should be no JavaScript error in the console.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt