Citations often have multiple values per field. In order to sort on one of these fields, the first value in the array can be used. This code adds the fields to the index by detecting fields with multiple values and adding the first one to an extra sorting field in the index.

CommentFileSizeAuthor
#1 sorts-625156-1.patch2.58 KBDavid Lesieur
sorts.patch4.45 KBrobertdouglass

Comments

David Lesieur’s picture

StatusFileSize
new2.58 KB

Re-rolled patch to remove changes to CVS headers. Not reviewed yet.

robertdouglass’s picture

Status: Needs review » Needs work

I think I prefer something more along the lines of this:

          $sort_index_key = FALSE;
          if ($biblio['multiple']) {
            $sort_index_key = 'sort_ss_' . $biblio['name'];
          }
robertdouglass’s picture

Status: Needs work » Closed (won't fix)

Refactoring is for loosers ;-)