getNonRootUser method sorting

Project:RUcore Account & Single Sign-on
Component:Database Layer and API
Category:bug report

When using the getNonRootUser() method the sorting used in the List Accounts option in Management isn't sorting properly. It appears to not be sorting naturally.



Status:active» test

By default, SQL order by returns uppercase first, then lowercase. If you want to sort regardless of case, you can try ['order_by'] = "lower(UserID)". -YY


Assigned to:yuyang» chadmills


Assigned to:chadmills» yuyang
Status:test» active

I get this error when attempting to implement lower(UserID)

faultCode0faultStringFatal error:Uncaught exception 'DbException' with message 'SQL exception in "select a.*, b.SourceID from ACCT_User a, ACCT_Source b where a.SourceNmbr = b.SourceNmbr and a.sourcenmbr = '101' order by a.lower(userid) asc": Query failed: FUNCTION a.lower does not exist.' in /mellon/htdocs/rucore/account/db/DbUserAccount.php:118 Stack trace: #0 /mellon/htdocs/rucore/account/db/DbUserAccount.php(153): DbUserAccount->getUser(Array) #1 /mellon/htdocs/rucore/account/interface/classes/Management.php(869): DbUserAccount->getNonRootUser(Array) #2 /mellon/htdocs/rucore/account/interface/classes/Management.php(981): Management->obtainDatabaseResults() #3 /mellon/htdocs/rucore/account/interface/views/management_accounts_list.php(123): Management->generateDivPanelHTML() #4 /mellon/htdocs/rucore/account/index.php(101): require('/mellon/htdocs/...') #5 {main} thrown in /mellon/htdocs/rucore/account/db/DbUserAccount.php on line 118


Status:active» test

Test again. -YY


Status:test» active

No error but the sorting still isn't correct.


The user accounts that were created during the test of the import process had a space in the front of the values. This is causing the sort to not work as expected. Please remove the space from the test accounts. Once removed the sorting should work as expected.


Chad, the import script needs to trim the value before inserting into database. If the script has been updated, we need to test the script to make sure the import feature works as expected. Manually removing space in database cannot accomplish this kind of test. I suggest we remove all imported values in database, then use the import utility to import data again. We can check the sorting after all these are done. -YY


I already added the trim function and tested it. Should we just manually delete those accounts then?


Status:active» fixed

Sorting is fine now. -YY


Status:fixed» closed

Back to top