Skip to content


UserManager.getUsersSitesFromAccess() doesn't order idsite #2151

JulienMoumne opened this Issue · 3 comments

3 participants


In my box test_setUserAccess_multipleCallDistinctAccessMultipleUser() fails because

$access1 = array( 'user1' => array(1,2), 'user2' => array(2,3) );
$wanted1 = array( 'user1' => array(1,2), 'user2' => array(3,2) );

This happens because getUsersSitesFromAccess() doesn't order column idsite.

Should we :

  • order idsite

  • sort the array before comparison


Interesting. Presumably, we can't expect login to be sorted either. I would add an "ORDER BY login,idsite" clause to the SQL.


sounds good


(In [4039]) fixes #2151 - ordering getUsersSitesFromAccess() SQL query, updating unit tests, should all API queries have an order by clause ?

@JulienMoumne JulienMoumne added this to the Piwik 1.2.1 milestone
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.