Summary: | JavaScript error on item search form unless NOT_LOAN defined | ||
---|---|---|---|
Product: | Koha | Reporter: | Owen Leonard <oleonard> |
Component: | Searching | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | claire_gravely, jonathan.druart, julian.maurice, kyle, mtj, nick |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
URL: | /cgi-bin/koha/catalogue/itemsearch.pl | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11425 | ||
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: | |||
Bug Blocks: | 18047 | ||
Attachments: |
Bug 16115: Remove JS error on item search if LOC does not exist
[SIGNED-OFF] Bug 16115: Remove JS error on item search if LOC does not exist Bug 16115: Remove JS error on item search if NOT_LOAN values do not exist |
Description
Owen Leonard
2016-03-21 18:28:02 UTC
I don't get this JS error. Looking at the code, it might appear if items.notforloan is not linked to any authorised values in your default framework. Could you confirm? Okay you're right it was an issue with my system: I had no "NOT_LOAN" authorized values! I must have removed them while testing something else. Should we add a check for this, or assume that no one running a real Koha installation is going to do that? No idea :) If we care about NOT_LOAN, we should care about others and everywhere. I'm seeing the same Syntaxerror as Owen after performing an item search and the results are being displayed below the search options, instead of on a clean page. SyntaxError: expected expression, got '}' /cgi-bin/koha/catalogue/itemsearch.pl Line 396 This occurs for us when no LOC value is present, which is the case for a number of libraries. If the library happens to have another custom authorised value, the error does not occur and in another case the use of bsort2 also removed the error. Created attachment 59396 [details] [review] Bug 16115: Remove JS error on item search if LOC does not exist 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 "Status" bloc is no longer displayed. There is no need to display it if empty. Created attachment 59659 [details] [review] [SIGNED-OFF] Bug 16115: Remove JS error on item search if LOC does not exist 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 "Status" bloc is no longer displayed. There is no need to display it if empty. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 59874 [details] [review] 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> Fixed commit message - LOC case handled on bug 18047 Pushed to master for 17.05, thanks Jonathan! This patch has been pushed to 16.11.x and will be in 16.11.04. Pushed to 3.22.x for 3.22.17 Pushed to 16.05.x, for 16.05.10 release |