Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sortable columns: #logins incorrect #164

Closed
ghost opened this issue May 22, 2014 · 6 comments
Closed

Sortable columns: #logins incorrect #164

ghost opened this issue May 22, 2014 · 6 comments
Labels

Comments

@ghost
Copy link

ghost commented May 22, 2014

Version 140520 adds several sortable columns to the Users panel. The results for # of Logins has a bit of a problem with significant digits. For example, the following is a highest first result for one level of users:
9, 9, 9, 86, 8, 8, 8, 7, 7, 7, 62, 62, 60, 6, 6, 55, 51, 51,5, 5, ...

Parts of 2 columns shown in attached image:
image

@jaswrks jaswrks added the bug label May 22, 2014
@jaswrks jaswrks added this to the Next Release milestone May 22, 2014
@clavaque
Copy link
Contributor

I see this in my test installation too.
2014-05-22_044829-login-count-sort-bug

@jaswrks
Copy link
Contributor

jaswrks commented May 22, 2014

Confirmed, me as well. Thanks for reporting this!

@ghost
Copy link
Author

ghost commented May 22, 2014

BTW...
This is a VERY WELCOME feature. I've used Bruce's sortable EOT column for a long time and am pleased to see the function extended to additional columns. Additionally, anyone who has Bruce's previous code as a MUPLUGIN coincident with this upgrade will find that clicking on the EOT column will return empty results.

I know you'll get it sorted. :)

@jaswrks
Copy link
Contributor

jaswrks commented May 22, 2014

@BruceCaldwell The issue here is that all of the meta fields are stored by WP as a TEXT column type. What needs to happen here; is that we need to CAST(meta_value AS UNSIGNED) on columns that are known to be numeric — before we do the sort.

@jaswrks
Copy link
Contributor

jaswrks commented May 22, 2014

@BruceCaldwell The same for timestamps too of course. This issue is not currently impacting those, but only because they are all the same length. Any numeric value needs to get sorted as UNSIGNED. I missed this before too.

@jaswrks
Copy link
Contributor

jaswrks commented May 23, 2014

Great, thanks! Closing this now. This fix will go out in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants