Bug 30693 - Javascript broken on request.pl
Summary: Javascript broken on request.pl
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 30457
Blocks:
  Show dependency treegraph
 
Reported: 2022-05-05 14:13 UTC by Nick Clemens
Modified: 2022-05-17 12:39 UTC (History)
5 users (show)

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


Attachments
Bug 30693: Javascript broken on request.pl (2.63 KB, patch)
2022-05-05 14:29 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 30693: Javascript broken on request.pl (2.69 KB, patch)
2022-05-05 14:41 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 30693: Javascript broken on request.pl (2.75 KB, patch)
2022-05-05 15:07 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2022-05-05 14:13:14 UTC
When placing a hold, after a patron is selected, there is an error:
Uncaught TypeError: tabs[0] is undefined

From bug 30457
Comment 1 Owen Leonard 2022-05-05 14:29:31 UTC
Created attachment 134643 [details] [review]
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.
Comment 2 Tomás Cohen Arazi 2022-05-05 14:41:06 UTC
Created attachment 134644 [details] [review]
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>
Comment 3 Martin Renvoize 2022-05-05 15:07:44 UTC
Created attachment 134651 [details] [review]
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>
Comment 4 Martin Renvoize 2022-05-05 15:08:30 UTC
Damn, annoyed I missed this during QA of 30457.. this fixes it nicely though..

PQA.. thanks for the quick followup.
Comment 5 Martin Renvoize 2022-05-05 15:13:14 UTC
Pushed for 22.05, thanks to everyone involved :)