Bug 9747 - sort issue for the z3950 results
Summary: sort issue for the z3950 results
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Fridolin Somers
QA Contact:
URL:
Keywords:
Depends on: 9450
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-05 10:12 UTC by Jonathan Druart
Modified: 2014-12-07 20:02 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 9747: Fix sorting issues on z3950 search results (2.53 KB, patch)
2013-03-05 13:01 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9747: Fix sorting issues on z3950 search results (2.51 KB, patch)
2013-03-19 10:19 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9747: Fix sorting issues on z3950 search results (2.56 KB, patch)
2013-03-20 09:33 UTC, Paul Poulain
Details | Diff | Splinter Review
Bug 9747: Fix sorting issues on z3950 search results (2.83 KB, patch)
2013-06-05 07:15 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9747: Fix sorting issues on z3950 search results (2.94 KB, patch)
2013-06-05 07:26 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 9747 - sort issue for the z3950 results (3.58 KB, patch)
2013-06-05 07:37 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 9747 - sort issue for the z3950 results - Followup (1.14 KB, patch)
2013-06-05 11:56 UTC, Fridolin Somers
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2013-03-05 10:12:23 UTC
When some results contain NSB/NSE characters (\x88 and \x89), the results are not well sorted.
To reproduce: search "tintin" on the BNF server.
Comment 1 Jonathan Druart 2013-03-05 13:01:17 UTC Comment hidden (obsolete)
Comment 2 jmbroust 2013-03-19 09:07:56 UTC
I tried to test on sandbox but had this message :
Applying: Bug 9747: Fix sorting issues on z3950 search results
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging koha-tmpl/intranet-tmpl/prog/en/js/datatables.js
CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/js/datatables.js
Failed to merge in the changes.
Comment 3 Jonathan Druart 2013-03-19 10:19:07 UTC Comment hidden (obsolete)
Comment 4 jmbroust 2013-03-19 15:17:34 UTC
Before the patch : Sorting by title works. 
After applying patch :
1) can't sort by title
2) the first title in the list is not Hergé
3) I cannot see any <td> </td> : which cell do i have to look at ? Is it title column in the table ?
Comment 5 Julian Maurice 2013-03-19 15:53:14 UTC
Maybe you just have to clear the cache of your browser.
I tested it and a javascript error occured the first time, causing the sort to not work. Then I cleared the cache (Ctrl + F5) and it worked.
Switching back to Needs signoff.
Comment 6 Fridolin Somers 2013-03-20 09:23:51 UTC
(In reply to comment #5)
> Maybe you just have to clear the cache of your browser.
> I tested it and a javascript error occured the first time, causing the sort
> to not work. Then I cleared the cache (Ctrl + F5) and it worked.
> Switching back to Needs signoff.

Indeed, cache of JavaScript sorting is very strong.
Tested with a browser without cache.
Comment 7 Paul Poulain 2013-03-20 09:33:00 UTC
Patch tested with a sandbox, by Cedric Vita <cedric.vita@dracenie.com>
Comment 8 Paul Poulain 2013-03-20 09:33:20 UTC Comment hidden (obsolete)
Comment 9 Chris Cormack 2013-06-05 00:06:43 UTC
Conflict in  koha-tmpl/intranet-tmpl/prog/en/js/datatables.js
Comment 10 Jonathan Druart 2013-06-05 07:15:49 UTC Comment hidden (obsolete)
Comment 11 Chris Cormack 2013-06-05 07:26:07 UTC
Created attachment 18656 [details] [review]
Bug 9747: Fix sorting issues on z3950 search results

At least the BNF server returns results containing non-sorting
characters (NSB SNE).
In order to sort results according these characters, this patch adds a
new Datatable function.

Test plan:
- search 'tintin' on the z3950 search (cataloguing/z3950_search.pl)
- sort on title (default sort) and check that results are not well
  sorted.
- apply this patch
- do the same search and check that the first result is "Hergé. Les
  Aventures de Tintin..."
  The value of the cell is:
      <td>Hergé. Les Aventures de Tintin...</td>

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Works as advertised and doesn't break existing searching
Comment 12 Fridolin Somers 2013-06-05 07:37:48 UTC Comment hidden (obsolete)
Comment 13 Fridolin Somers 2013-06-05 07:40:40 UTC
You may test with Tolkien as author, you get :
The Lord of the rings, The Two towers, The Return of the king, ...

Note that NSB and NSE are not visible in MARC popup view, but if you copy/paste the title in an advanced editor (like Geany), you will see them.
Comment 14 Fridolin Somers 2013-06-05 10:04:26 UTC
Oups, we both worked on this bug.
I revert my patch, I will add it in a new bug since it adds features.
So I set PassedQA.
Comment 15 Fridolin Somers 2013-06-05 11:56:06 UTC
Created attachment 18669 [details] [review]
Bug 9747 - sort issue for the z3950 results - Followup

Finally I created a follow-up just to add the new sort in z3950 in acquisition module.
Also adds default sorting on title column.

This feature is really usefull I bet.
Thanks all for your work.
Comment 16 Galen Charlton 2013-10-09 04:25:26 UTC
Pushed to master.  Thanks, Jonathan!