If you go to the "Users by Points" link (/userpoints), then a "(details)" link shows up next to your own username. But this link still takes the user to /myuserpoints and results in a Page Not Found error.

I discussed this with Berdir and here's what he said:

myuserpoints still exists but you must pass the uid, for your own page too. This is something we should probbaly improve. I suggest you create a new issue for the broken details link. Also, that link should be displayed for all users when you have the required permissions.

--Ben

Comments

berdir’s picture

Ok, so here is my suggestion:

We do the very exact thing that Privatemsg and UR are already doing.

We move viewing other user's points and transactions to user/%uid/points. That will also get us a nice breadcrumb (#1020126: Incorrect breadcrumb on points transaction view page).

Any objections? ;)

BenK’s picture

Makes sense to me! :-)

berdir’s picture

Component: Code: userpoints API » Code: userpoints
Status: Active » Needs review
StatusFileSize
new7.88 KB

Ok, attaching a first patch.

- Adds Points local tasks (with list, view, edit, approve, decline local tasks just like in the admin listing)
- details link on /userpoints now shows for all users if you have the necessary permissions and points to the corresponding page.

Do we also want to unify the myuserpoints page with the same local tasks? I guess so, but not yet done.

BenK’s picture

Status: Needs review » Needs work

Berdir,

I just tested your patch and things seem to work well if you click "(details)" from the "User by Points" page (/userpoints). But if you click "(details)" from the "Totals" tab in the admin section (admin/config/people/userpoints), then you get the following errors:

Notice: Trying to get property of non-object in userpoints_list_my_userpoints() (line 40 of /Users/benkaplan/git/drupal-7.0b/sites/all/modules/userpoints/userpoints.pages.inc).
Notice: Trying to get property of non-object in userpoints_get_categories() (line 1613 of /Users/benkaplan/git/drupal-7.0b/sites/all/modules/userpoints/userpoints.module).
Notice: Trying to get property of non-object in userpoints_get_categories() (line 1629 of /Users/benkaplan/git/drupal-7.0b/sites/all/modules/userpoints/userpoints.module).
Notice: Trying to get property of non-object in userpoints_list_my_userpoints() (line 51 of /Users/benkaplan/git/drupal-7.0b/sites/all/modules/userpoints/userpoints.pages.inc).
Notice: Trying to get property of non-object in userpoints_list_my_userpoints() (line 60 of /Users/benkaplan/git/drupal-7.0b/sites/all/modules/userpoints/userpoints.pages.inc).
Notice: Trying to get property of non-object in userpoints_list_my_userpoints() (line 117 of /Users/benkaplan/git/drupal-7.0b/sites/all/modules/userpoints/userpoints.pages.inc).

Also, when you click the details link from this page, you are linked to a "!Points for Anonymous" page instead of a points page for the specific user who was clicked.

Also, I'm not seeing the Points local tasks (with list, view, edit, approve, decline local tasks just like in the admin listing). Where are these supposed to show up? I agree that we should unify the /myuserpoints page with the same local tasks as used elsewhere.

--Ben

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new12.88 KB

Ok, here is a new patch.

- Unified the local tasks for all 3 locations where transactions are shown (admin, user/%user/points, myuserpoints), the view/edit links are now always get built so that you stay where you are.
- Fixed the link on the admin points listing
- Note that the category select filter is currently broken. Fixing that wouldn't be easy and there is no point in doing so, because it is going to be refactored in #1134644: Rewrite the category filter form to use #ajax after this issue anyway. So don't bother testing :)

BenK’s picture

Status: Needs review » Reviewed & tested by the community

Hey Berdir,

This latest patch rocks! It's so nice to have local tasks that keep you where you are in context. Awesome work!

So I tested everything out and this is RTBC. :-)

--Ben

P.S. I'd suggest that we next tackle http://drupal.org/node/1070134 (Make the view transaction page match the edit transaction page). That issue should be a very quick fix and it's more noticeable that the view and edit pages don't match now that we have such nice and consistent local tasks. ;-)

berdir’s picture

Status: Reviewed & tested by the community » Fixed

Ok, commited.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.