OK, this patch is a conglomeration of all the hacking i've done on this module recently.
- Anonymous users were not able to flag content by other anonymous users. Added an option to allow this.
- There were some other issues in the code that prevented flagging by anonymous users from working in general, these were changed.
- There's a scenario where a node could be flagged as abuse enough to be hidden, "Allowed" by the moderator, and subsequently edited by the user again to contain bad stuff. Normally the node would then be unflaggable and therefore unhideable since it had been "Allowed" earlier. Added an option to "un-moderate" a post which gets edited, meaning it can be flagged, hidden, and reviewed again if need be.
- Enabled the display of the "Abuse form intro text", which was previously not displayed anywhere
- Fixed the bug where all sets of "allow, remove, etc" buttons on the moderation page operate on the first item
- Display the reason the user picked on the flag form for each report in the moderation interface.
I'm relatively sure that all my changes added features/functionality without breaking any existing code (it works for me, obviously), but I haven't tested it super-thoroughly.
let me know if you see any problems with this, or any other ideas to implement and I'll see what i can do.
Comment | File | Size | Author |
---|---|---|---|
#8 | abuse.module.0.1.patch | 8.15 KB | Anonymous (not verified) |
#3 | abuse.module.new_.patch | 8.15 KB | Anonymous (not verified) |
abuse.module_0.patch | 3.48 KB | Anonymous (not verified) |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedOh yeah, one other thing I forgot that this patch does:
- Creates a field for customizing the name of the link users see on nodes to something other than "Flag as offensive"
Comment #2
mr.andrey CreditAttribution: mr.andrey commentedHello,
I'm getting the following error on the node listing page after applying the patch:
warning: Missing argument 1 for abuse_operations_form() in /home/.puppy/fredburks/portal.transformationteam.net/sites/all/modules/abuse/abuse.module on line 643.
The flagging process seems to be working, and the intro text is now showing.
Thanks,
Andrey.
P.S. Do you think you could upload patches drupal style with the -up flag? It's easier to see the context this way.
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedweird, I can't reproduce that error - what action are you trying to do when it shows up?
Here's the patch with the flags you requested - I'll remember to use that in the future, thanks.
Comment #4
mr.andrey CreditAttribution: mr.andrey commentedThe error just appears on every page, even admin settings page where Flag should not be displayed at all.
I just checked the patch and removed my own comments, so the line numbers should now be the same.
warning: Missing argument 1 for abuse_operations_form() in /home/.puppy/fredburks/portal.transformationteam.net/sites/all/modules/abuse/abuse.module on line 632.
Thanks,
Andrey.
Comment #5
mr.andrey CreditAttribution: mr.andrey commentedAlso, whenever I try to create a new object (blog,article,event,etc), I get instead the form [allow][remove][warn & remove],etc.
Andrey.
Comment #6
onionweb CreditAttribution: onionweb commentedI'm getting the form buttons appearing in every form too, even the search form in the masthead of my site.
But only on my dev server. On the live site it's working fine. Not sure why.
Comment #7
onionweb CreditAttribution: onionweb commentedif(strpos($form_id,"abuse_operations_form") == 0)
needs to be
if(strpos($form_id,"abuse_operations_form") === 0)
that will fix the buttons appearing everywhere
actually it could probably just be
if(strpos($form_id,"abuse_operations_form"))
Comment #8
Anonymous (not verified) CreditAttribution: Anonymous commentedI found a bug in the code I added, and I think it may have been causing your problem. I was using == when I should have been using ===.
Try patching a clean version of abuse.module with the patch i attached and see if it's any less horrible...
Comment #9
mr.andrey CreditAttribution: mr.andrey commentedSeems to be working now, thanks!!
Comment #10
Coyote CreditAttribution: Coyote commentedAre the features in this other patch:
http://drupal.org/node/164670
Also included in this patch?
Comment #11
Anonymous (not verified) CreditAttribution: Anonymous commentedno, but it probably doesn't interfere with the functionality that patch adds, so you might be able to combine them. Probably the best course would be to try to get the module maintainer to merge both patches into the module itself.
Comment #12
introfini CreditAttribution: introfini commentedHi,
I can't find out why you made the variable $reasons static in the function _abuse_reasons(). Can you please explain or is it a bug? It conflicts with my patch http://drupal.org/node/185165.
Thanks for your patch; I built mine on top of yours.
Regards,
introfini
Comment #13
Anonymous (not verified) CreditAttribution: Anonymous commentedhm, I see the declaration you're talking about around line 1030(approx.): static $reasons;
but i didn't add that, it was part of the original module, and I have no idea why it was done that way. Probably not much help, but is that what you're asking about?
Comment #14
introfini CreditAttribution: introfini commentedYes, that’s the one. I’m sorry I thought that was your patch that added that to the code, but you are right it was on the original module already.
I think that you patched that function so it can filter by reason id ($arid), but if that function is called a second time with some parameter for $arid it always return the full array of reasons. If the declaration static is removed that don’t happens.
Thanks,
introfini
Comment #15
jaydub CreditAttribution: jaydub commentedComment #16
jaydub CreditAttribution: jaydub commentedFYI I am pulling out some of the fixes in the patches submitted to this issue and adding into HEAD.
Comment #17
tj2653 CreditAttribution: tj2653 commentedThanks jaydub,
Did you include the patch for: "Fixed the bug where all sets of "allow, remove, etc" buttons on the moderation page operate on the first item" or not yet?
EDIT: looks like you got it now: http://drupal.org/node/147643
-tj2653