There is one template in the OPAC, opac-topissues.tt, which uses a special DataTables sorting routine called "title-numeric." This can be replaced with sorting via a data-order attribute, and the custom routine can be removed.
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]