getNonRootUser method sorting

Project:RUcore Account & Single Sign-on
Version:7.3
Component:Database Layer and API
Category:bug report
Priority:normal
Assigned:yuyang
Status:closed
Description

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.

Comments

#1

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

#2

Assigned to:yuyang» chadmills

#3

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

#4

Status:active» test

Test again. -YY

#5

Status:test» active

No error but the sorting still isn't correct.

#6

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.

#7

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

#8

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

#9

Status:active» fixed

Sorting is fine now. -YY

#10

Status:fixed» closed

Back to top