Download & Extend

Namespace the user votes tab and move access check to access callback

Project:Vote Up/Down
Version:6.x-3.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)
Issue tags:interoperability

Issue Summary

In the function vud_user_votes() use the function argument passed by the menu handler instead of arg(1)

Change from:

function vud_user_votes() {
  if ($account = user_load(array('uid' => arg(1), 'status' => 1))) {

to:

function vud_user_votes($account) {
  if(!is_object($account)) $account = user_load(array('uid' => arg(1), 'status' => 1));
  if ($account) {

This change will avoid the use of arg(1) and will make it compatibility with the me module #925882: user/me/votes not mapped to user/[uid]/votes

Comments

#1

Status:active» needs review

patch for vud.module attached

AttachmentSizeStatusTest resultOperations
vote_up_down-1024138-1.patch554 bytesIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch vote_up_down-1024138-1.patch. This may be a -p0 (old style) patch, which is no longer supported by the testbots.View details

#2

Title:Use function argument instead of arg» Namespace the user votes tab
Status:needs review» needs work

I see what you mean.

But the real problem is that we are using "votes" string as we are the only module handling votes :-p

So, I would be glad to commit a patch that provides a better menu path, namespacing it.

I mean, changing:
$items['user/%user/votes'] with $items['user/%user/vote_up_down/votes'.

It is going to need a menu rebuilt on a hook_update_N().

#3

Title:Namespace the user votes tab» Namespace the user votes tab and move access check to access callback
Status:needs work» fixed

I changed a little the patch, and then pushed! (to 6.x-3.x and 6.x-2.x)

Thanks for reporting and providing the patch.

AttachmentSizeStatusTest resultOperations
0001-Issue-1024138-by-nohup-marvil07-Namespace-the-user-v.patch3.9 KBIgnored: Check issue status.NoneNone

#4

Version:6.x-3.x-dev» 7.x-1.x-dev
Status:fixed» patch (to be ported)

I think 7.x can use this :-p

#5

Version:7.x-1.x-dev» 6.x-3.x-dev
Status:patch (to be ported)» fixed

Maybe is better to drop that feature for 7.x, I just realized that it's vud_node specific, so it should live there. Anyway, moving to old state.

#6

Status:fixed» closed (fixed)

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

nobody click here