Topic: Ordering of termlist cache lookups
I've been struggling to get my select lists for terms to reflect the sort_order field when using the "cache" view. The list actually appear in descending order of the "sort_order" field. I'm specifically using a select list in "complex_attr_grid" which uses the cache view, but I think that this problem will occur for any cache termlist lookups.
I think that I've narrowed the issue down to seemingly strange behaviour in postgresql (9.3). For some reason a descending index is being applied when a single termlist_id is being selected (as an integer).
If I run:
select * from cache_termlists_terms
or
select * from cache_termlists_terms where termlist_id = 54.0
then the output is correctly in ascending order, but if I use:
select * from cache_termlists_terms where termlist_id = 54
select * from cache_termlists_terms where termlist_id between 54 and 55
and some other variants, then it is shown in descending order.
This seems like unexpected behaviour in postgresql, so I wondered whether anyone else has encountered this or similar issues and maybe found a way of making the indexing consistent.
I have temporarily edited our copy of data_entry_helper.php to make complex_attr_grid use the "list"view, but there must be a proper solution to be found.
IT Manager: Species Conservation
Wildfowl & Wetlands Trust