When a user goes to /userpoints a report is displayed that, by default, is supposed to display each user's point balance in all categories. (The "Filter by category" selector defaults to "Display all").
In my testing, only the uncategorized points are displayed on the report.
I can change the selector to view other categories but when I choose "Display all" I see a report of uncategorized points (see attachment).
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | Picture 1.png | 19.93 KB | jredding |
| #2 | display_all.patch | 623 bytes | kmillecam |
| #2 | display_all.png | 28.67 KB | kmillecam |
| userpoints.png | 26.78 KB | kmillecam |
Comments
Comment #1
kbahey commentedSeems this need the tid of 'all' like we discussed in the other issue?
Comment #2
kmillecam commentedThis patch fixes part of the problem by removing the 'GROUP' portion of the db query. Since we're looking for a comprehensive list of points all users have in all categories, using GROUP returns a result set that's smaller than what we expect.
There's another issue though. The only way to get the complete list (after the patch is applied) is to click the /userpoints menu -- choosing "Display all" in the filter doesn't do anything.
Here's the chunk of code I modified (look for comments near the bottom).
Comment #3
kmillecam commentedKhalid,
After I submitted the patch, I realized that "users by points" should indeed be a list of all users and a summary of the points (across all categories) that they've earned.
So, I guess two approaches/queries are necessary (similar to the 'all' solution we discussed the other day).
1) if no tid is passed, the query should include a SUM() to aggregate the category totals.
2) if a tid is passed, the existing query works to list an individual category and the points each users have earned in that category.
Comment #4
ilo commentedI guess the problem is at line 1235 of userpoints.module of the 5.x-3.2 release also..
1235 $output = drupal_get_form('userpoints_filter_cat_select', 'userpoints/', arg(3));
The filtering is not using the $tid variable passed in function definition..:
1232 function theme_userpoints_list_users(&$rows, &$tid, &$pager_limit) {
Replacing arg(3) with $tid will render the select list right solving the original problem.
It's..
1235: $output = drupal_get_form('userpoints_filter_cat_select', 'userpoints/', $tid);
Sorry, I've not patch installed in this pc..
Comment #5
jredding commentedilo is correct. the "bug" is in the theme function. This should have been set to $tid so that the dropdown menu would have been set to the correct default category.
However the title suggests something different.
The Display All does in fact work as intended. ALL categories are shown but, just like the other items, the intent was not to show SUMed categories but EVERY category. The attached screen shot shows this in action and working. Version 3.2 with ilo's fix is in use (and committed to cvs).
I'm changing the category on this over to "Feature Request" as its not a bug.
I'm changing the title to properly reflect the feature request.
The feature request as I understand it is..
Add the ability to display SUMed user points (a sum of all the user points across all categories) to the /userpoints page.
To implement this.
rewrite the original SQL query in userpoints_list_users
Comment #6
kmillecam commentedSounds good Jacob.
Thanks for taking a look at this, committing the fix, and adding this to the requested feature list.
Kevin
Comment #7
ilo commentedgood work :)
Comment #8
berdirSorry for spamming the participants in this issue. Due to the release of Drupal 7 and the lack of time from the maintainers, I'm closing all remaining 5.x issues for Userpoints.
Feel free to re-open this issue or create a new one for 6.x or even better 7.x if this bug is still open or feature is missing for these versions.