Bug 18047

Summary: JavaScript error on item search form unless LOC defined
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: SearchingAssignee: Nick Clemens (kidclamp) <nick>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: claire_gravely, fridolin.somers, julian.maurice, kyle, mtj, mtompset, oleonard
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19706
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 16115    
Bug Blocks:    
Attachments: Bug 18047 - JavaScript error on item search form unless LOC defined
Bug 18047 - JavaScript error on item search form unless LOC defined
Bug 18047 - JavaScript error on item search form unless LOC defined

Description Nick Clemens (kidclamp) 2017-02-03 11:36:47 UTC
If LOC is not present, the item search form will raise a JS error:
SyntaxError: expected expression, got '}'
Comment 1 Nick Clemens (kidclamp) 2017-02-03 11:40:59 UTC
Created attachment 59875 [details] [review]
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.
Comment 2 Mark Tompsett 2017-02-13 02:22:52 UTC
Didn't cleanly apply without applying 16115 first. :)
Comment 3 Mark Tompsett 2017-02-13 02:23:32 UTC
Created attachment 60135 [details] [review]
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>
Comment 4 Jonathan Druart 2017-02-14 10:18:31 UTC
Created attachment 60179 [details] [review]
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>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 5 Kyle M Hall (khall) 2017-02-14 14:11:38 UTC
Pushed to master for 17.05, thanks Nick!
Comment 6 Katrin Fischer 2017-02-14 20:53:29 UTC
This patch has been pushed to 16.11.x and will be in 16.11.04.
Comment 7 Julian Maurice 2017-02-20 10:02:38 UTC
Pushed to 3.22.x for 3.22.17
Comment 8 Mason James 2017-02-23 20:22:19 UTC
Pushed to 16.05.x, for 16.05.10 release