Bug 13054

Summary: Allow server-side sorting by title to ignore custom sets of articles
Product: Koha Reporter: Owen Leonard <oleonard>
Component: Staff interfaceAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: gmcharlt, martin.renvoize, nick
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13070
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 13054: Added sort 'anti-the' to title

Description Owen Leonard 2014-10-09 14:27:18 UTC
When sorting clent-side DataTables-enhanced tables by title, it's possible to use a custom sorting algorithm to ignore articles, based on this configuration in datatables-strings.inc:

var CONFIG_EXCLUDE_ARTICLES_FROM_SORT = _("a an the");

...and the "anti-the" sorting code in js/datatables.js. This doesn't work with server-side DataTables implementations, which means that sorting by title on the circulation and patron detail pages no longer works as well as it did before those pages were redone with AJAX datatables.

I would like to see some kind of implementation which continued to enable the user to define articles to exclude from sorting and would work at the database level so that AJAX datatables could be correctly sorted.
Comment 1 Martin Renvoize 2014-10-09 15:23:35 UTC
Created attachment 32093 [details] [review]
Bug 13054: Added sort 'anti-the' to title
Comment 2 Martin Renvoize 2014-10-09 15:24:43 UTC
A tad confused... I just added the 'anti-the' to checkouts.js and found it appeared to be working for me..

See patch for the super tiny change..

Maybe i'm not looking in the right place though.
Comment 3 Owen Leonard 2014-10-09 16:48:30 UTC
(In reply to Martin Renvoize from comment #2)
> I just added the 'anti-the' to checkouts.js and found it
> appeared to be working for me..

Yes, that works for me too. However, if I try to add something similar to manage-marc-imports.tt it doesn't work (Line 38):

-              { "mDataProp": "citation" },
+              { "mDataProp": "citation", "sType": "anti-the" },
Comment 4 Nick Clemens 2020-01-07 14:28:47 UTC
*** Bug 13070 has been marked as a duplicate of this bug. ***
Comment 5 Nick Clemens 2020-01-07 14:32:53 UTC
A possible workaround for titles at least would be to respect the non-filing indications into the title field in the DB, or a new title_sort field - this would need to address the different MARC21/UNIMARC implementations