There is all user's Ads are coming in 'My Classified Ad list' link

eg. URL Path:
index.php?q=user/1/ed-classified

Comments

phdhiren’s picture

Status: Active » Needs review
StatusFileSize
new1.29 KB

I've find out my self this patch to this problem. It works for me.

mcurry’s picture

Status: Needs review » Needs work

Thanks for the patch.

This patch doesn't seem right to me; why the line:

page arguments' => array(1),

?

From what I can see, the argument to the page function should be a user object representing the current user, not an array containing the value '1'... or have I missed something?

phdhiren’s picture

It is correct and as per D6 Menu system overview

Instead of %node here it is %user and on 1st argument we get $account value

tomws’s picture

EDIT: Correction. The patch does solve the first problem below. Looks like I was having a caching issue. Now I just need to get my permissions issue sorted.

I made the adjustments from this patch to the three lines manually, but it doesn't change anything here. I'm still seeing all users' ads on the 'My @name list'. Dropping in some debug output also still shows that $uid == 0 in the body of ed_classified_admin_overview.

I put this right under the $can_edit test at line 319:

  $uidTest = $uid == $user->uid;
  $output  = "<div>uid == user->uid:--".(int)$uidTest."--</div>";
  $output .= "<div>uid:--".(int)$uid."--</div>";
  $output .= "<div>user->uid:--".(int)$user->uid."--</div>";
  $output .= "<div>canedit:--".(int)$can_edit."--</div>";
  return $output;

Output for authenticated user with 'edit own classified ads' permission (user 5):

uid == user->uid:--0--
uid:--0--
user->uid:--5--
canedit:--0--

Output for admin (user 1):

uid == user->uid:--0--
uid:--0--
user->uid:--1--
canedit:--1--

These are the same results as before making the 3 line changes from the patch.

The initial cause for my looking for a solution is that users with the 'edit own' privileges don't get a link to edit their ads. Attempting to visit the edit page for the ad (/node/##/edit) results in access denied. I'm assuming these problems are related and have the same root cause in the uid handling.

NoFuel’s picture

Patch not working for me too. Any suggestions?

milesgillham’s picture

Assigned: Unassigned » milesgillham

I've tested and I think the patch does work, just have to be sure you've flushed any caches. I'll roll it into the alpha release.

Cheers,

Miles

milesgillham’s picture

Status: Needs work » Fixed

Applied to 6.x development branch.

phdhiren’s picture

@milesgillham: thanks applying patch to dev branch.

Status: Fixed » Closed (fixed)

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