Summary: | JavaScript error on place hold page in the staff interface | ||
---|---|---|---|
Product: | Koha | Reporter: | Owen Leonard <oleonard> |
Component: | Hold requests | Assignee: | Owen Leonard <oleonard> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P5 - low | CC: | david, fridolin.somers, gmcharlt, martin.renvoize |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
This patch fixes the cause of a JavaScript console error ("Uncaught ReferenceError: $ is not defined") when placing a hold using the staff interface. It:
- Moves the "$.fn.select2.defaults" definition from the top of the page to the bottom so that jQuery is loaded first.
- Improves the display of the dropdown list for the pickup library so that the width is wider.
|
Version(s) released in: |
21.05.00
|
Circulation function: | |||
Bug Depends on: | 27016 | ||
Bug Blocks: | 27733 | ||
Attachments: |
Bug 27732: JavaScript error on place hold page in the staff interface
Bug 27732: JavaScript error on place hold page in the staff interface Bug 27732: JavaScript error on place hold page in the staff interface |
Description
Owen Leonard
2021-02-19 13:48:47 UTC
Created attachment 117086 [details] [review] Bug 27732: JavaScript error on place hold page in the staff interface This patch moves the "$.fn.select2.defaults" definition from the top of the page to the bottom so that jQuery will be loaded first. The patch also changes the "dropdownAutoWidth" default so that the dropdown is sized correctly for its contents, regardless of the width of the initial <select>. To test, apply the patch and place a hold in the staff interface for a title which already has existing holds. - On the "Place a hold" page, before selecting a patron, you should see a table of exising holds. Test the "Pickup library" dropdown. It should work correctly. - The width of the dropdown should accommodate its contents without forcing any library name to wrap. - There should be no errors in the browser console. Created attachment 117102 [details] [review] Bug 27732: JavaScript error on place hold page in the staff interface This patch moves the "$.fn.select2.defaults" definition from the top of the page to the bottom so that jQuery will be loaded first. The patch also changes the "dropdownAutoWidth" default so that the dropdown is sized correctly for its contents, regardless of the width of the initial <select>. To test, apply the patch and place a hold in the staff interface for a title which already has existing holds. - On the "Place a hold" page, before selecting a patron, you should see a table of exising holds. Test the "Pickup library" dropdown. It should work correctly. - The width of the dropdown should accommodate its contents without forcing any library name to wrap. - There should be no errors in the browser console. Signed-off-by: David Nind <david@davidnind.com> Testing notes: - The console error appeared for me even if no holds had been placed (that is, there were no holds on the item). - This improves the display of items in the dropdown list. However, if a shorter library name is displayed, some longer library names are still wrapped when the dropdown list is selected (such as Institut Protestant de Théologie), however it is much improved from what it was before. Created attachment 117157 [details] [review] Bug 27732: JavaScript error on place hold page in the staff interface This patch moves the "$.fn.select2.defaults" definition from the top of the page to the bottom so that jQuery will be loaded first. The patch also changes the "dropdownAutoWidth" default so that the dropdown is sized correctly for its contents, regardless of the width of the initial <select>. To test, apply the patch and place a hold in the staff interface for a title which already has existing holds. - On the "Place a hold" page, before selecting a patron, you should see a table of exising holds. Test the "Pickup library" dropdown. It should work correctly. - The width of the dropdown should accommodate its contents without forcing any library name to wrap. - There should be no errors in the browser console. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Works well, QA scripts pass.. a solid improvement. Passing QA Pushed to master for 21.05, thanks to everybody involved! |