Bugzilla – Attachment 60135 Details for
Bug 18047
JavaScript error on item search form unless LOC defined
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18047 - JavaScript error on item search form unless LOC defined
Bug-18047---JavaScript-error-on-item-search-form-u.patch (text/plain), 2.29 KB, created by
Mark Tompsett
on 2017-02-13 02:23:32 UTC
(
hide
)
Description:
Bug 18047 - JavaScript error on item search form unless LOC defined
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2017-02-13 02:23:32 UTC
Size:
2.29 KB
patch
obsolete
>From 449e4c3dc68c05ffa3c5321aa95780bed1b6f3ce Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 3 Feb 2017 11:38:53 +0000 >Subject: [PATCH] Bug 18047 - JavaScript error on item search form unless LOC > defined > >If LOC 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 LOC authorised values >Go on the item search form >=> You will not get the JS error and the "Shelving location" bloc is no longer >displayed. There is no need to display it if empty. > >Signed-off-by: Mark Tompsett <mtompset@hotmail.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 d2b0d7f..e88d774 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt >@@ -293,7 +293,11 @@ > { 'type': 'text' }, > { 'type': 'select', 'values': [% branches.json %] }, > { 'type': 'select', 'values': [% branches.json %] }, >- { 'type': 'select', 'values': [% locations.json %] }, >+ [% IF locations.size %] >+ { 'type': 'select', 'values': [% locations.json %] }, >+ [% ELSE %] >+ null, >+ [% END %] > { 'type': 'text' }, > [% IF notforloans.size %] > { 'type': 'select', 'values': [% notforloans.json %] }, >@@ -401,11 +405,13 @@ > options = branches > empty_option = "All libraries" > %] >- [% INCLUDE form_field_select >- name="location" >- options = locations >- empty_option = "All locations" >- %] >+ [% IF locations.size %] >+ [% INCLUDE form_field_select >+ name="location" >+ options = locations >+ empty_option = "All locations" >+ %] >+ [% END %] > </fieldset> > <fieldset> > [% INCLUDE form_field_select >-- >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 18047
:
59875
|
60135
|
60179