Glossary Page alphabetical sorting Messed Up.

abramo - March 16, 2009 - 17:39
Project:Glossary
Version:5.x-2.7
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:active
Description

On "Glossary Page", sorting of terms is not executed as true alphabetical sorting, as one would expect, but in a peculiar "hierarchical" manner. Glossary module in my setup extracts terms from a single vocabulary configured with "single hierarchy" - and what I get within a specific letter is sorting determined by parent terms in that vocabulary. These parent terms don't, of course, display in the sorted list (if they do not start with the specific letter) but they totally determine the sorting order !

While all terms listed under a specific letter do indeed start with that specific letter, sorting is totally messed up. This renders the alphabetical glossary unusable, as it is not a true alphabetical index but a messed up alphabetical index. Yes, all terms start with the same letter, but what is the use?

This issue seems somehow inherent in Drupal taxonomy sorting - same issue is affecting the Glossary module. It needs urgent review. As it stands, the alphabetical function is unusable.

#1

jvieille - March 19, 2009 - 12:48

Same problem here with D6.10

It appears that glossary (or something else???) sometimes weighs the term, sometimes not.
I don't see any reason to weigh glossary terms: the Zero value will sort everything correctly based on the alphabetic order.

Please, make sure no weigh is allocated when creating a term and provide an option to reset all weigh to Zero!

#2

arlmedia - December 18, 2009 - 15:07

If the alphabetical sorting needs to be applied while still using the editorial weighting in taxonomy we have for our work on www.gelenk-doktor.de developed a patch to the glossary module (carefiul: breaks the upgrade path) :

$tree = taxonomy_get_tree($vid); $ tree = taxonomy_get_tree ($ vid);
// Now the code of Arlmedia:
usort($tree, '_glossary_cmp'); usort ($ tree, '_glossary_cmp');

// We add the following function.

function _glossary_cmp($a, $b) { _glossary_cmp function ($ a, $ b) (
return strcasecmp ($a->name , $b->name); return strcasecmp ($ a-> name, $ b-> name);
} )

More details to are on www.arlmedia.eu/node/46

 
 

Drupal is a registered trademark of Dries Buytaert.