Summary: | Remove use of title-numeric sorting routine from OPAC datatables JS | ||
---|---|---|---|
Product: | Koha | Reporter: | Owen Leonard <oleonard> |
Component: | OPAC | Assignee: | Owen Leonard <oleonard> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | kyle, lucas |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Trivial patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: |
22.05.00
|
Circulation function: | |
Attachments: |
Bug 29949: Remove use of title-numeric sorting routine from OPAC datatables JS
Bug 29949: Remove use of title-numeric sorting routine from OPAC datatables JS Bug 29949: Remove use of title-numeric sorting routine from OPAC datatables JS |
Description
Owen Leonard
2022-01-26 12:18:28 UTC
Created attachment 129824 [details] [review] Bug 29949: Remove use of title-numeric sorting routine from OPAC datatables JS This patch removes the use of a specific "title-numeric" sorting routine from the DataTables configuration of the "Most popular" table. We can use a "data-order" attribute instead. The patch also removes the now unused code from our custom DataTables JS file in both the OPAC and the staff interface (where it was unused). To test, apply the patch and make sure the OpacTopissue system preference is enabled. - In the OPAC, view the "Most popular" page. - Change the filter settings, if necessary, to get multiple results. - In the results table, confirm that sorting by number of checkouts still works correctly. A search of the code for instances of "title-numeric" should return only one in a comment in the official DataTables library. Created attachment 129836 [details] [review] Bug 29949: Remove use of title-numeric sorting routine from OPAC datatables JS This patch removes the use of a specific "title-numeric" sorting routine from the DataTables configuration of the "Most popular" table. We can use a "data-order" attribute instead. The patch also removes the now unused code from our custom DataTables JS file in both the OPAC and the staff interface (where it was unused). To test, apply the patch and make sure the OpacTopissue system preference is enabled. - In the OPAC, view the "Most popular" page. - Change the filter settings, if necessary, to get multiple results. - In the results table, confirm that sorting by number of checkouts still works correctly. A search of the code for instances of "title-numeric" should return only one in a comment in the official DataTables library. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> before patch: root@kohadevbox:koha(master)$ git grep 'title-numeric' koha-tmpl/intranet-tmpl/lib/datatables/datatables.js: * $.fn.dataTable.ext.type.search['title-numeric'] = function ( d ) { koha-tmpl/intranet-tmpl/prog/js/datatables.js: * { "sType": "title-numeric" }, koha-tmpl/intranet-tmpl/prog/js/datatables.js: "title-numeric-pre": function ( a ) { koha-tmpl/intranet-tmpl/prog/js/datatables.js: "title-numeric-asc": function ( a, b ) { koha-tmpl/intranet-tmpl/prog/js/datatables.js: "title-numeric-desc": function ( a, b ) { koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-topissues.tt: { "type": "title-numeric", "targets" : [ "title-num"] }, koha-tmpl/opac-tmpl/bootstrap/js/datatables.js: * { "sType": "title-numeric" }, koha-tmpl/opac-tmpl/bootstrap/js/datatables.js: "title-numeric-pre": function ( a ) { koha-tmpl/opac-tmpl/bootstrap/js/datatables.js: "title-numeric-asc": function ( a, b ) { koha-tmpl/opac-tmpl/bootstrap/js/datatables.js: "title-numeric-desc": function ( a, b ) { after patch: root@kohadevbox:koha(master)$ git grep 'title-numeric' koha-tmpl/intranet-tmpl/lib/datatables/datatables.js: * $.fn.dataTable.ext.type.search['title-numeric'] = function ( d ) { Created attachment 129972 [details] [review] Bug 29949: Remove use of title-numeric sorting routine from OPAC datatables JS This patch removes the use of a specific "title-numeric" sorting routine from the DataTables configuration of the "Most popular" table. We can use a "data-order" attribute instead. The patch also removes the now unused code from our custom DataTables JS file in both the OPAC and the staff interface (where it was unused). To test, apply the patch and make sure the OpacTopissue system preference is enabled. - In the OPAC, view the "Most popular" page. - Change the filter settings, if necessary, to get multiple results. - In the results table, confirm that sorting by number of checkouts still works correctly. A search of the code for instances of "title-numeric" should return only one in a comment in the official DataTables library. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Pushed to master for 22.05, thanks to everybody involved [U+1F984] |