View Issue Details

IDProjectCategoryView StatusLast Update
1763RackTablesdefaultpublic2017-08-18 15:56
Reporterdmnmitsupu Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status acknowledgedResolutionopen 
Product Version0.20.14 
Summary1763: Tag Sorting in Drop Down
DescriptionTags are not sorted alphabetically in drop down menu to select tags.
TagsNo tags attached.
Attached Files

Activities

adoom42

adoom42

2017-08-09 05:54

administrator   ~0003665

Browsing around demo.racktables.org, the tags look sorted to me. Please provide steps to reproduce and/or screenshots.
adoom42

adoom42

2017-08-18 05:33

administrator   ~0003675

Closing ticket, please re-open if you can provide steps to reproduce the sorting issue.
dmnmitsupu

dmnmitsupu

2017-08-18 05:43

reporter   ~0003677

Sorry I missed your reply on the 9th.

Here is my convo with Dennis back In June:

Denis Ovsienko denis@ovsienko.info via freelists.org
    
Jun 2
    
to racktables-use.
---- On Thu, 01 Jun 2017 15:48:14 +0100 Chris James<chris@datacate.com> wrote ----
 > Hi all,
 >
 > I am noticing as we are using more and more tags for the first time they do not appear in alphabetical order when selecting from the drop down. Is it possible to fix this or is this a setting I am missing?

Hello Chris.

I have poked around relevant bits of code a little and found two cases where the tags sort order is not alphabetical (it is not the same even between those two cases). This looks like a bug but I could not see a proper solution for it today.
dmnmitsupu

dmnmitsupu

2017-08-18 05:45

reporter   ~0003679

Screenshot
Capture.PNG (28,770 bytes)   
Capture.PNG (28,770 bytes)   
dmnmitsupu

dmnmitsupu

2017-08-18 05:47

reporter   ~0003681

Also - This still exists in 20.14 as well. I am unable to update the version in the ticket.
infrastation

infrastation

2017-08-18 15:56

administrator   ~0003683

What I remember is that the very first implementation of tags in RackTables used PHP sorting. Quite soon it turned out the sorting only worked well for the 7-bit ASCII tags because PHP at that time wasn't equipped to compare UTF-8 strings properly (the fact this bug exists and my comment above may be due the same reason still standing, I cannot tell reliably right now).

As a solution to that problem I changed the code to make the MySQL server sort the tags (traditionally it gets character sets much better) and then in PHP to save the order of the table row into "ci" (collation index) PHP array key such that a simple numeric sorting by that key would reproduce the MySQL order. For a while that worked quite well.

A few years later the "ci" key was removed, probably because it was blocking some other internal change, and some other PHP-level code put into place to sort the tags, I presume that time it worked otherwise there would be bug reports. But apparently right now it does not work as intended.

Issue History

Date Modified Username Field Change
2017-06-03 17:20 dmnmitsupu New Issue
2017-08-09 05:54 adoom42 Note Added: 0003665
2017-08-09 05:54 adoom42 Status new => feedback
2017-08-09 05:54 adoom42 Summary Tag Soring in Drop Down => Tag Sorting in Drop Down
2017-08-18 05:33 adoom42 Note Added: 0003675
2017-08-18 05:34 adoom42 Assigned To => adoom42
2017-08-18 05:34 adoom42 Reproducibility always => unable to reproduce
2017-08-18 05:34 adoom42 Status feedback => closed
2017-08-18 05:34 adoom42 Resolution open => unable to reproduce
2017-08-18 05:43 dmnmitsupu Status closed => feedback
2017-08-18 05:43 dmnmitsupu Resolution unable to reproduce => reopened
2017-08-18 05:43 dmnmitsupu Note Added: 0003677
2017-08-18 05:45 dmnmitsupu File Added: Capture.PNG
2017-08-18 05:45 dmnmitsupu Note Added: 0003679
2017-08-18 05:45 dmnmitsupu Status feedback => assigned
2017-08-18 05:47 dmnmitsupu Note Added: 0003681
2017-08-18 06:27 adoom42 Assigned To adoom42 =>
2017-08-18 06:27 adoom42 Reproducibility unable to reproduce => always
2017-08-18 06:27 adoom42 Status assigned => acknowledged
2017-08-18 06:27 adoom42 Resolution reopened => open
2017-08-18 06:27 adoom42 Product Version 0.20.13 => 0.20.14
2017-08-18 15:56 infrastation Note Added: 0003683