Bugzilla – Attachment 59874 Details for
Bug 16115
JavaScript error on item search form unless NOT_LOAN defined
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16115: Remove JS error on item search if NOT_LOAN values do not exist
Bug-16115-Remove-JS-error-on-item-search-if-NOTLOA.patch (text/plain), 2.32 KB, created by
Nick Clemens (kidclamp)
on 2017-02-03 11:32:24 UTC
(
hide
)
Description:
Bug 16115: Remove JS error on item search if NOT_LOAN values do not exist
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2017-02-03 11:32:24 UTC
Size:
2.32 KB
patch
obsolete
>From a13d9a010f43b47b3d1f1e550aed3735dfd9dcc1 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Sat, 21 Jan 2017 08:48:20 +0100 >Subject: [PATCH] Bug 16115: Remove JS error on item search if NOT_LOAN values > do not exist > >If NOT_LOAN is not present, the item search form will raise a JS error: >SyntaxError: expected expression, got '}' > >This patch fixes it by handling this specific case. > >Note that the "Status" column is still displayed. > >Test plan: >Remove your NOT_LOAN authorised values >Go on the item search form >=> You will not get the JS error and the "Status" bloc is no longer >displayed. There is no need to display it if empty. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > .../prog/en/modules/catalogue/itemsearch.tt | 18 ++++++++++++------ > 1 file changed, 12 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt >index ff0a930..d2b0d7f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt >@@ -295,7 +295,11 @@ > { 'type': 'select', 'values': [% branches.json %] }, > { 'type': 'select', 'values': [% locations.json %] }, > { 'type': 'text' }, >- { 'type': 'select', 'values': [% notforloans.json %] }, >+ [% IF notforloans.size %] >+ { 'type': 'select', 'values': [% notforloans.json %] }, >+ [% ELSE %] >+ null, >+ [% END %] > { 'type': 'text' }, > null > ] >@@ -414,11 +418,13 @@ > options = ccodes > empty_option = "All collection codes" > %] >- [% INCLUDE form_field_select >- name="notforloan" >- options = notforloans >- empty_option = "All statuses" >- %] >+ [% IF notforloans.size %] >+ [% INCLUDE form_field_select >+ name="notforloan" >+ options = notforloans >+ empty_option = "All statuses" >+ %] >+ [% END %] > </fieldset> > <fieldset> > [% INCLUDE form_field_select_text_block %] >-- >2.1.4
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 16115
:
59396
|
59659
| 59874