Great to see you working again on this module. While flag_abuse was in hiatus I discovered flag_note (http://drupal.org/project/flag_note) which can be used for an abuse-like system.
The benefit of flag_note is the "note" function. It seems pretty common to provide the person flagging content with the opportunity to write some lines of explanation. So a feature like this would be a nice addition for flag_abuse anyways.
I cannot judge this from a technical standpoint (maybe you are willing to provide some insight?) but to me both modules seem to have a lot in common from a user perspective. Flag_abuse has of course a very focused use case and I can understand if you want to leave it as light as possible.
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | 895418-flag_abuse-flag_note-2x.patch | 1.8 KB | hanoii |
| #21 | 895418-flag_abuse-flag_note.patch | 6.39 KB | hanoii |
| #7 | flag_abuse-flag_note-895418.patch | 7.49 KB | sirkitree |
| #5 | flag_abuse-flag_note-895418.patch | 2.72 KB | sirkitree |
Comments
Comment #1
sirkitree commentedThere was a bit of an issue with our 1.x version and flag_note #601724: Issue with flag abuse+flag note and I do think it would be nice to have them integrated somehow. I'm open to suggestions on accomplishing this. Haven't reviewed that module yet though.
I'm thinking it would take making abuse flags dynamic, as in being able to designate any flag as an abuse flag rather than the ore restricted approach that it takes now, where it only operates on three distinct flags only.
... actually now that I've just read the README for flag_note - it's a link type ... so this might just work out of the box - when you install flag_abuse, enable one of the abuse flags and choose the note link type. hrm...
Comment #2
sirkitree commentedhrm, so just took a few minutes to try it out - i've installed the 2.x-dev version of flag_note on a project i'm working on, set my existing abuse flag to use the link type, and HEY! it even gave me a modalframe! seem to work pretty well!
So, i'll not merge with flag note, but they can certainly be used together! :)
Comment #3
sirkitree commentedHrm, actually it's a little bit wonky. When you go to reset the flag, it still comes up with the flag-note... I've altered the confirmation form, looks like we'll have to do something specific with this as well... reopening, updating title.
Comment #4
sirkitree commentedchanging the flag's action to reset in hook_preprocess_flag is very likely the cause. It doesn't really serve much of a purpose anyway, so it's safe to remove that. Then I can just extend our form alter to check for the flag note form and change the text around for now.
Comment #5
sirkitree commentedSo, this seems to work alright - let me know what you think.
Patch removes the alteration of the flag action, uses form_alter instead of form_FORM_ID_alter, then refactors the checks a little and will alter the flag_note_form if it finds it.
The one thing that is a little wonky, is that even thought we're altering the flag_note_form, this note is recorded and then immediately removed because we're in the process of 'removing' all flags... so it's really pointless to add a message at this juncture. But, at least it probably makes sense to a user now.
Comment #6
sirkitree commentedOf course part of this is that we'll probably want to add in the flag_note relationship and field to the default views we provide.
Comment #7
sirkitree commentedAttached patch does everything in #5 as well as uses hook_views_pre_view() to alter the default views and add in the flag note relationship and field.
Comment #8
dddave commentedGreat...I guess. ;)
Is this patch included in the latest dev? I failed to patch the dev and finally cygwin told me that the patch seemed to be already applied. Might have messed this up but usually I CAN patch.
Anyways: I could need some guiding words about how to use this now. What is the workflow now and which flags do I need to set for a content-type (or comment).
Comment #9
sirkitree commentedseems to apply alright to me... make sure you have the latest DRUPAL-6--2 branch from cvs, download this file to the flag_abuse directory and (from command line)
$ patch -p0 < flag_abuse-flag_note-895418_0.patch--- terminal paste ---
Comment #10
dddave commentedI dont' know what I am doing wrong here but I cannot get it to go, sorry.
"can't find file to patch at input line 4"
Comment #11
manos_ws commentedThe patch is not in the correct format. It can only be applied to the sirkitree’s site.
You have to manually apply the patch by editing the files which are indicated in the patch file.
Remove the lines with the minus - sign and add the lines with the + sign to the corresponding files in the appropriate places.
I applied the patch and it works with a minor problem.
When the user resets a flag when he is returned to the view he gets a message
The patch is almost there.
One issue I want to get noted is the "Make permanent nature of reset flags optional" http://drupal.org/node/917372
Manos
http://websynergy.gr/
Comment #12
teezee commentedThe change implemented by the patch, where hook_form_FORM_ID_alter() is changed to hook_form_alter() makes all the flag checking and access checking on ALL FORMS. That's something you shouldn't want happening. For example, there is no check to see if
$form['flag_name']['#value'];is actually available as field in the form. In my opinion the form alter at least should check which form is about to be altered, before performing all kinds of checks:Comment #13
hanoiiInterested in this feature
Comment #14
Fidelix commentedVery interested...
Comment #15
sirkitree commentedIf you're interested, please test the patch and report your findings.
Comment #16
hanoiiwhat will happen with this on 2.x? is there a patch to test against that version?
EDIT: Sorry, got really confused about module version, actually using 2.x and knowing this issue is for 2.x. Ignore this comment, still a bit sleepy.
Comment #17
hanoiiPatch indeed failed to apply with
patch -p0 < patch. The problem is that the patch was created from a different root folder than the module itself, the following will work if you are running the patch from within the module:sirktree can apply the patch properly on #9 with -p0 because he does have the patch's actual directory structure on his computer.
Just as a guide for creating patches, from http://drupal.org/patch/create:
Comment #18
hanoiiFrom what I tested so far, its working. I am using flag_note with flag_abuse properly. I might be missing something but this worth committing and then fix if necessary.
Comment #19
hanoiiActually, looking it further the reset flag is still launching the modalframe and it's not properly modified, probably because I might have changed it a bit. In anyway, this module shouldn't alter flag_note form, it's just too prone to inconsistencies.
I will suggest and soon submit another approach.
The reset link should not really be handled by flag_note, so we need a way to tell flag_note not to add the flag_note behavior to the flag.
I am thinking of following the same approach as modalframe API which is to add a flagnote-exclude class to the flag link. I will then submit a patch to the flagnote module (which seems to be quite responsive) to exclude flag links with that flag. Thus any module doing something like yours might benefit from it.
Comment #20
hanoiiactually, I think what I said on #19 might not be easy/the proper way to go. Will look more into this and report back.
Comment #21
hanoiiI have been working today as I need both modules nicely working together. I finally worked in the same line as in #7, I did it a bit different.
I left the previous confirm alter the way it was and create a new alter for the flag_note form which is removing/changing the proper elements. Patch on #7 has mistakes on that front.
New additions to flag_note that I submitted today and were committed will help a bit more with the user part of the integration, I suggest trying the latest dev of flag_note when it's there.
Worth noting that I haven't reviewed the extra default views addition of this patch.
I also added one class (flag-abuse-reset) to the link so it can help theming.
Comment #22
hanoiiWorth noting that #1024678: empty data can be stored on the db on flag_note needs reviewing/accepting to prevent empty data be stored when the modified form of this patch is submitted.
Comment #23
hanoiiI have now a comment on the views modification of this part. It's adding a relationship on the
flag_abuse_views_pre_view(). I don't think this is necessary or appropriate. This relationship remains hidden to the administration of the views. I even didn't realize it was there and I actually add the relationship myself.I wouldn't add a relationship there, I rather leave that to the flag_note module user to set it up manually on the views. Another option is to add it on the default, but I think this is just too much of an integration. Views should remain configurable to the user as much as possible.
Attached is a patch w/o it.
Comment #24
q0rban commentedsubscribe
Comment #25
kenorb commented+1
Comment #26
brunorios1 commented+1
Comment #27
kenorb commentedDrupal 6 is no longer officially supported. If you think this issue is still relevant for 8.x, feel free to re-open.