Bugzilla – Attachment 134651 Details for
Bug 30693
Javascript broken on request.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30693: Javascript broken on request.pl
Bug-30693-Javascript-broken-on-requestpl.patch (text/plain), 2.75 KB, created by
Martin Renvoize (ashimema)
on 2022-05-05 15:07:44 UTC
(
hide
)
Description:
Bug 30693: Javascript broken on request.pl
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-05-05 15:07:44 UTC
Size:
2.75 KB
patch
obsolete
>From 68f5641b7c1e6548dcf9dc956fca83d178217bf9 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 5 May 2022 14:21:19 +0000 >Subject: [PATCH] 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> >--- > .../prog/en/modules/reserve/request.tt | 23 +++++++++++-------- > 1 file changed, 13 insertions(+), 10 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index 5319d2fec4..65d95f6e0f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -1194,16 +1194,19 @@ > } > }); > >- [% SET active = clubs ? 1 : 0 %] >- /* Set active tab based on whether a club search was submitted */ >- var tabs = $("#circ_holds_select li:eq(" + [% active | $raw %] + ") a").tab("show"); >- $( tabs[0].hash ).find("input.focus").focus(); >- >- /* Change active focus when tabs change */ >- $("#circ_holds_select a[data-toggle='tab']").on("shown.bs.tab", function (e) { >- active_tab = e.target.hash; >- $( active_tab ).find("input.focus").focus(); >- }); >+ if( $("#circ_holds_select").length > 0 ){ >+ [% SET active = clubs ? 1 : 0 %] >+ /* Set active tab based on whether a club search was submitted */ >+ var tabs = $("#circ_holds_select li:eq(" + [% active | $raw %] + ") a").tab("show"); >+ $( tabs[0].hash ).find("input.focus").focus(); >+ >+ /* Change active focus when tabs change */ >+ $("#circ_holds_select a[data-toggle='tab']").on("shown.bs.tab", function (e) { >+ active_tab = e.target.hash; >+ $( active_tab ).find("input.focus").focus(); >+ }); >+ } >+ > > function ToggleHoldsToPlace() { > if ( $("#requestany").prop('checked') ) { >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30693
:
134643
|
134644
| 134651