various issues fixed/features added

anonymous5190 - August 15, 2007 - 05:53
Project:abuse
Version:5.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:jaydub
Status:patch (code needs review)
Description

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.

AttachmentSize
abuse.module_0.patch3.48 KB

#1

anonymous5190 - August 15, 2007 - 06:01

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"

#2

mr.andrey - August 15, 2007 - 16:52

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.

#3

anonymous5190 - August 16, 2007 - 02:22

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.

AttachmentSize
abuse.module.new_.patch8.15 KB

#4

mr.andrey - August 16, 2007 - 16:10

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.

#5

mr.andrey - August 16, 2007 - 16:57

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

Andrey.

#6

onionweb - August 16, 2007 - 18:46

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.

#7

onionweb - August 16, 2007 - 18:55

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

#8

anonymous5190 - August 16, 2007 - 19:00
Assigned to:Anonymous» anonymous5190

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

AttachmentSize
abuse.module.0.1.patch8.15 KB

#9

mr.andrey - August 17, 2007 - 02:52

Seems to be working now, thanks!!

#10

Coyote - September 25, 2007 - 19:18

Are the features in this other patch:

http://drupal.org/node/164670

Also included in this patch?

#11

anonymous5190 - September 26, 2007 - 18:17

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.

#12

introfini - October 21, 2007 - 00:07

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

#13

anonymous5190 - October 25, 2007 - 16:55

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?

#14

introfini - October 25, 2007 - 19:55

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

#15

jaydub - March 13, 2008 - 09:05
Assigned to:anonymous5190» jaydub

#16

jaydub - March 17, 2008 - 10:56

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

#17

tj2653 - March 26, 2008 - 20:19

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

 
 

Drupal is a registered trademark of Dries Buytaert.