Index: trunk/extensions/Wikidata/OmegaWiki/SpecialSelect.php |
— | — | @@ -60,6 +60,7 @@ |
61 | 61 | $options_res = $dbr->query( $sql ); |
62 | 62 | |
63 | 63 | $optionsString = ''; |
| 64 | + $optionsArray = array() ; |
64 | 65 | while ( $options_row = $dbr->fetchObject( $options_res ) ) { |
65 | 66 | /* Use a simpler query if the user's language is English. */ |
66 | 67 | if ( $lang_code == 'en' || !( $lang_id = getLanguageIdForCode( $lang_code ) ) ) { |
— | — | @@ -95,11 +96,16 @@ |
96 | 97 | |
97 | 98 | $spelling_res = $dbr->query( $sql ); |
98 | 99 | $spelling_row = $dbr->fetchObject( $spelling_res ); |
99 | | - if ( $optionsString != '' ) |
100 | | - $optionsString .= "\n"; |
101 | | - $optionsString .= $options_row->option_id . ';' . $spelling_row->spelling; |
| 100 | + |
| 101 | + $optionsArray[$options_row->option_id] = $spelling_row->spelling ; |
102 | 102 | } |
103 | 103 | |
| 104 | + asort( $optionsArray ) ; |
| 105 | + foreach ($optionsArray as $option_id => $spelling ) { |
| 106 | + if ( $optionsString != '' ) $optionsString .= "\n"; |
| 107 | + $optionsString .= $option_id . ';' . $spelling ; |
| 108 | + } |
| 109 | + |
104 | 110 | return $optionsString; |
105 | 111 | } |
106 | 112 | |