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.

CommentFileSizeAuthor
#8 abuse.module.0.1.patch8.15 KBAnonymous (not verified)
#3 abuse.module.new_.patch8.15 KBAnonymous (not verified)
abuse.module_0.patch3.48 KBAnonymous (not verified)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

Oh 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"

mr.andrey’s picture

Hello,

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.

Anonymous’s picture

FileSize
8.15 KB

weird, 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.

mr.andrey’s picture

The 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.

mr.andrey’s picture

Also, whenever I try to create a new object (blog,article,event,etc), I get instead the form [allow][remove][warn & remove],etc.

Andrey.

onionweb’s picture

I'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.

onionweb’s picture

if(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"))

Anonymous’s picture

Assigned: Unassigned »
FileSize
8.15 KB

I 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...

mr.andrey’s picture

Seems to be working now, thanks!!

Coyote’s picture

Are the features in this other patch:

http://drupal.org/node/164670

Also included in this patch?

Anonymous’s picture

no, 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.

introfini’s picture

Hi,

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

Anonymous’s picture

hm, 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?

introfini’s picture

Yes, 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

jaydub’s picture

Assigned: » jaydub
jaydub’s picture

FYI I am pulling out some of the fixes in the patches submitted to this issue and adding into HEAD.

tj2653’s picture

Thanks 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