View Issue Details

IDProjectCategoryView StatusLast Update
0015481mantisbtcustom fieldspublic2017-08-19 21:32
ReporterJP_MRX Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
OSWin XP 
Product Version1.2.12 
Target Version1.2.15Fixed in Version1.2.15 
Summary0015481: Custom fields values are not sorted in the main filter
Description

In the "view issues" main filter, a list with all the values used for each custom field is displayed but unsorted. The selection is not easy for numerous values.

The list is built by the custom_field_distinct_values function in custom_field_api and should be sorted by adding "ORDER BY cfst.value" on line 1164.

TagsNo tags attached.

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 
has duplicate 0005683 closedcproensa Drop-down boxes of Customfield filters could be sorted 

Activities

dregad

dregad

2013-02-09 11:42

developer   ~0035092

This issue was probably introduced in 1.2.12 by commit b5abce1f, as the query retrieving the custom field values was rewritten with a SELECT DISTINCT instead of using a GROUP BY clause. With MySQL, group by sorts the results, whereas distinct does not (not tested with other rdbms).

I'll add the ORDER BY clause as suggested. Thanks for the bug report.

grangeway

grangeway

2013-04-05 17:56

reporter   ~0036093

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

Related Changesets

MantisBT: master-1.2.x 645ac2e9

2013-02-09 11:54

dregad


Details Diff
Fix 0015481: custom field values sort order in view all page filter

Commit b5abce1f917da688c86aec17dee11111ced5f0b7 introduced a regression
in the sort order of custom field values because the query retrieving
the custom field values was rewritten with a SELECT DISTINCT instead of
using a GROUP BY clause. With MySQL, group by sorts the results, whereas
distinct does not (not tested with other RDBMS).

This fixes the issue by adding an ORDER BY clause.
Affected Issues
0015481
mod - core/custom_field_api.php Diff File

MantisBT: master b8dc9937

2013-02-09 11:54

dregad


Details Diff
Fix 0015481: custom field values sort order in view all page filter

Commit b5abce1f917da688c86aec17dee11111ced5f0b7 introduced a regression
in the sort order of custom field values because the query retrieving
the custom field values was rewritten with a SELECT DISTINCT instead of
using a GROUP BY clause. With MySQL, group by sorts the results, whereas
distinct does not (not tested with other RDBMS).

This fixes the issue by adding an ORDER BY clause.
Affected Issues
0015481
mod - core/custom_field_api.php Diff File