Skip to content

Loading…

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

Closed
JulienMoumne opened this Issue · 3 comments

3 participants

@JulienMoumne
Piwik Open Source Analytics member

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

@robocoder

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

@mattab
Piwik Open Source Analytics member

sounds good

@JulienMoumne
Piwik Open Source Analytics member

(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.