? Success
Referenced as Related to: # 4679

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
16 Oct 2014

This PR fix the issue #4679 reported by @dkanchev. Basically, if your site has multiple languages installed, when you are on login page to login to administrator area of your site, the languages in languages dropdown might be displayed in random order (see #4679 for more detail).

I just added one line of code to make sure the languages are sorted based on locale code instead of random order before (although this is difficult to replicate this issue).

How to test

  1. Make sure your site has atleast two languages installed.

  2. Access to administrator area of your site, makes sure the language dropdown is sorted based on locale code instead of in a random order as explained in the issue.

avatar joomdonation joomdonation - open - 16 Oct 2014
avatar jissues-bot jissues-bot - change - 16 Oct 2014
Labels Added: ?
avatar infograf768
infograf768 - comment - 16 Oct 2014

I can't reproduce the issue here.
Languages are alpha ordered by language code:
below
de-DE
en-GB
es-ES
fr-FR
it-IT
mk-MK
ta-IN
screen shot 2014-10-16 at 08 47 33

avatar brianteeman
brianteeman - comment - 16 Oct 2014

@infograf I can't reproduce it either but as Daniel said it is specific to
certain storage . I have however seen it happen that is why I confirmed it
On 16 Oct 2014 07:50, "infograf768" notifications@github.com wrote:

I can't reproduce the issue here.
Languages are alpha ordered by language code:
below
de-DE
en-GB
es-ES
fr-FR
it-IT
mk-MK
ta-IN
[image: screen shot 2014-10-16 at 08 47 33]
https://cloud.githubusercontent.com/assets/869724/4658611/af7f67e2-5500-11e4-9b02-de6bbd7a8114.png


Reply to this email directly or view it on GitHub
#4690 (comment).

avatar infograf768
infograf768 - comment - 16 Oct 2014

@test
adding ksort() has no undesired effect here.
Please correct code style to let us merge this PR.

avatar nicksavov nicksavov - change - 16 Oct 2014
Labels Added: ?
avatar javigomez
javigomez - comment - 16 Oct 2014

I haven't yet check the changes but Travis complains for code style issues in this pull:

FILE: ...avis/build/joomla/joomla-cms/administrator/modules/mod_login/helper.php
--------------------------------------------------------------------------------
FOUND 2 ERROR(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
 35 | ERROR | Opening parenthesis of a multi-line function call must be the
    |       | last content on the line
 38 | ERROR | Closing parenthesis of a multi-line function call must be on a
    |       | line by itself
--------------------------------------------------------------------------------
avatar joomdonation
joomdonation - comment - 16 Oct 2014

@ALL : Sorry, the code of my first commit is clearly wrong. It has no affect to the $languages array and doesn't solve the issue.

@dkanchev: Your code should work as well. However, I think the code of my second commit is sorter and easier to read:

usort($languages, function ($a, $b)
{
    return strcmp($a["value"], $b["value"]);
});

However, it still has problem with code style. Anyone here know how to correct it and can help me with this codestyle issue ?

avatar joomdonation
joomdonation - comment - 16 Oct 2014

OK. I was able to fix the code style issue. Please help testing it again :).

avatar dkanchev
dkanchev - comment - 16 Oct 2014

The proposed patch resolves the issue. Tested and works as expected :)

avatar brianteeman
brianteeman - comment - 16 Oct 2014

Awesome

On 16 October 2014 13:44, dkanchev notifications@github.com wrote:

The proposed patch resolves the issue. Tested and works as expected :)


Reply to this email directly or view it on GitHub
#4690 (comment).

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar joomdonation
joomdonation - comment - 16 Oct 2014

I think this PR can be merged now. Thanks All :).

avatar infograf768
infograf768 - comment - 16 Oct 2014

I wish I could first test this here locally.
let me first test if no issue on my settings before merging

avatar joomdonation
joomdonation - comment - 16 Oct 2014

Thanks @infograf768.

avatar infograf768
infograf768 - comment - 16 Oct 2014

No unwanted effect here. Languages are still presented alpha by lang tag

avatar infograf768 infograf768 - close - 16 Oct 2014
avatar infograf768 infograf768 - change - 16 Oct 2014
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2014-10-16 13:16:24

Add a Comment

Login with GitHub to post a comment