[EP-tech] Re: Sort result by author, by title

Mark Gregson mark.gregson at qut.edu.au
Tue Dec 18 00:33:59 GMT 2012


Hi Mario



We had the same problem in 3.2. I think the solution was to implement a custom orderkey on the author's id field which our author view is based on (in our repository the id field contains family_name + given_name). The custom order key uses Text::Unidecode<http://search.cpan.org/perldoc/Text::Unidecode> to strip the diacritics from letters for sorting and grouping purposes. See example below.



use Text::Unidecode;



sub make_id_orderkey_single

{

      my ( $self, $value, $session, $langid, $dataset ) = @_;



      # convert to upper case ASCII

      my $orderkey = uc( unidecode( $value ) );



      # ignore apostrophes and hyphens

      $orderkey =~ s/['-]//g;



      return $orderkey

}



Kind regards

Mark

Mark Gregson | Applications and Development Team Leader
Library eServices | Queensland University of Technology
Level 3 | R Block | Kelvin Grove Campus | GPO Box 2434 | Brisbane 4001
Phone: +61 7 3138 3782 | Web: http://eprints.qut.edu.au/<http://www.qut.edu.au/>
ABN: 83 791 724 622
CRICOS No: 00213J








-----Original Message-----

From: eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk> [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Mario Beaudoin

Sent: Tuesday, 18 December 2012 6:13 AM

To: eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>

Subject: [EP-tech] Sort result by author, by title



Hello



I use eprints 3.3.7 in dev server  and 3.2.9 in production and i notice then both when we use a french accent in the authors name the sort do not use utf8_general _ci to sort correctly the é goes after the z letter (like we use utf8_bin) (in browse by author and in sort by author or title after search) i look in the sql table eprint_ordervalue_fr  creators_name the collate is utf8_general_ci that sort perfecly (phpmyadmin) i already have this bug in older version of eprints and to correct the bug i modify utf8_bin to utf8_general_ci who sort everyting correcly after this change but now the table collation is correct so i take a look on view.pl but nothing there to sort i take a look on view.pm who seem to sort the browse by author but i am not sure what to modify exactly



Thank for your help



look here the Bé... is at the end of B letter http://espace.etsmtl.ca/view/creators/index.B.html



or this one whewe É is a new letter after the A http://espace2.etsmtl.ca/view/master_director/index.A-=C9.html



Mario





*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech

*** Archive: http://www.eprints.org/tech.php/

*** EPrints community wiki: http://wiki.eprints.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20121218/48df5b94/attachment.html 


More information about the Eprints-tech mailing list