Having problems on a live site, not sure where to start bug testing but I need to resolve this ASAP
| Project: | Classified Ads |
| Version: | 5.x-1.5-8 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | won't fix |
Jump to:
This is 5.x-1.5-8, NOT a 6.0 version (I saw there is a bug for editng ads in 6.x, and it is not the same issue here). The problem is that some users are not able to edit their ads after they are created. I don't know if it takes a few weeks to happen, but I have a handful of users who cannot. I copied my site over to a test area to try and recreate the problem, but I have been unsuccessful.
I used a known account that had problems, and I could not edit their ad. I created a new ad and was able to edit it. I do not get the option on the old ad to edit it when I am logged in as that user. I tried logging out and back in, and I still was given the option to edit the new ads I created, but not the original one. What in the world is going on, and what other troubleshooting steps can I take?

#1
Is the difference for those users that the ad has already expired? Just looking at the D5 code it does not appear to allow user editing or resetting if the ad has expired. That would explain why it takes a bit of time to show up. Users who edit/reset their ad prior to expiry wouldn't have a problem. The workaround is to go in as admin and reset the expiry date, and then the user should be able to resume editing. Let me know.
Cheers,
Miles
#2
Thanks for the help. It is not an issue with the ads expiring. They expire after 6 months, and these are about two months old. The expiration date is at the end of the year. I have about 300 ads on my site, and so far I only know 3 that cannot edit their ad. There could be more but I have not heard from anyone else, and I don't want to go through each account testing it.
#3
I can't offer an immediate solution, but when I'm prepping the next 5.x release this week I can ad some courtesy messages to tell a user why they are not allowed to edit an ad - that should shed some light on why it thinks they're not allowed to. In the process of adding those messages I may stumble upon code logic that gives more of a hint. At this point I'm thinking those ads are in some way "corrupted" in so far as ed_classified treats them, but it's hard to guess how just yet, given that it's a circumstance that only affects some users and indicates in some way that those users are different in some way.
Once I have that instrumentation put into the 5.x branch I'll post an update letting you know how to to proceed (either by pulling down the -dev image or applying a patch).
In the meantime please try this: As Administrator go into one of the uneditable ads and reset the expiration. Then go back in as the user - is it now editable? If not, then go back in as Administrator but this time make a minor change to the ad text and save the ad. Then go back in as the user - is it now editable? If the ad becomes editable by either action that will give a hint (and a temporary workaround).
Regards,
Miles
#4
Have you changed default input filters, and/or restricted access to input filters that were once available to normal users?
When encountering mystery problems related to users being unable to edit nodes they've created, check this article: Why can't A Drupal user edit a node they created? before looking for problems in custom modules. This problem may be due to a longstanding issue in Drupal core. If a node is created using an input filter, then the administrator removes general permission to use that filter, the node authors (if they no longer have access to use the input filter) won't be able to edit the nodes, and no diagnostic error message is given, thus making it very difficult to diagnose this problem.
I opened a Drupal core issue on this problem #91663: Disappearing edit tabs due to input format permissions. in October of 2006. Still not fixed in any released version of Drupal. Go figure.
#5
Oh, man. That really is an issue and it would appear that this is what is going on for tyler-durden. This part of node_access() runs before invoking hook_access():
// If the node is in a restricted format, disallow editing.if ($op == 'update' && !filter_access($node->format)) {
return FALSE;
}
Which means that ed_classified won't even have a chance to allow/disallow editing.
@tyler-durden: the workaround from grateful_drupal_user should solve your problem. Go back into one of the "stuck" ads and check that the input filter is set to one that the user is allowed to use. Post back if that is helping.
Cheers,
Miles
#6
I'm going to put this into "Won't Fix" status since I am starting to make plans to convert to 6.x, AND I have only found 2 of my 500 live ads having this problem (from what I can find).