We have some interesting code in our datatables wrappers to magically sort on 'title' attributes found in spans in table fields (When the headings are marked up with 'title-string' and 'title-number' classes). This is weird and a mis-use of the HTML title attribute. It results in tooltips being generated for all fields witch such values and often those tooltips are confusing/mismatched. We should replace these with either data- attributes or perhaps use hidden datatables columns for sorting? Basically.. there must be a better way.
It must be data-order https://datatables.net/manual/data/orthogonal-data#HTML-5 We use it already in a few places.
That's a really useful page of documentation Jonathan, thanks for linking it :)
Created attachment 118182 [details] [review] Bug 27934: Update waiting_holds.inc to use data-order This patch updates the waiting_holds table to use data-order attributes on the "Waiting since" and "Date hold placed" fields. Test plan 1/ Prior to applying the patch navigate to a page that displays waiting holds 2/ Hover over the the "Waiting since" and "Date hold placed" data fields and note that you are faced with a tooltip with the iso formatted date. 3/ Apply the patch 4/ Check that sorting still works as expected for the two columns 5/ You should no longer be able to trigger the tooltip
Example patch.. there's allot of these to fix...
Find more cases with a simple grep for 'title-string' in the templates directories
Created attachment 118206 [details] [review] Bug 27934: Update waiting_holds.inc to use data-order This patch updates the waiting_holds table to use data-order attributes on the "Waiting since" and "Date hold placed" fields. Test plan 1/ Prior to applying the patch navigate to a page that displays waiting holds 2/ Hover over the the "Waiting since" and "Date hold placed" data fields and note that you are faced with a tooltip with the iso formatted date. 3/ Apply the patch 4/ Check that sorting still works as expected for the two columns 5/ You should no longer be able to trigger the tooltip Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Sorry, I keep jumping too soon - who knew that signing off bugs was so exciting? ;) Happy to sign off again once it's ready for testing.
I agree that we should update the templates to use the newer sorting option. I've updated the bug title to make it clear that it's about an obsolete option.
Still a couple of occurrences in waiting_holds.inc then we are good to remove the functions in datatables.js
Added a QA check https://gitlab.com/koha-community/qa-test-tools/-/issues/48 Issue #48 - Forbid title-string class for sorting
Recent push : Bug 27926: Add 'title-string' for dates on circ-patron-results Does it need to be patched ?
(In reply to Fridolin Somers from comment #11) > Recent push : > Bug 27926: Add 'title-string' for dates on circ-patron-results > > Does it need to be patched ? That already had a follow-up to fix it :)
It looks like we sill got some remaining title-string attributes: koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc: { "targets": [ "title-string" ], "type": "title-string" }, koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_to_pull.tt: <th class="recall-date title-string">Earliest recall date</th> koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_to_pull.tt: { "sType": "title-string", "aTargets" : [ "title-string" ] }, koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.tt: <th class="recall-waitingdate title-string">Available since</th> koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.tt: <th class="recall-waitingdate title-string">Available since</th>
columns_settings.inc is obviously correct The recall ones need to be adjusted.