Hi,

I was missing a generic integration of some extended rules arguments like
- "node author" in context of node flags
- "comment author" in context of comment flags
- "comment node author" in context of comment flags
to apply some of the multiple user/node actions, delivered by other modules.

Issue #688318: Send an email with Rules to node author when flagged addressed the "node author" argument in a specific usage. But the solution does not help in my case.

I added a short patch against 6.x-2.0-beta3, which extends flag rules integration by the mentioned arguments in a generic way to achieve maximal flexiblity.

Comments

YK85’s picture

subscribing

TS79’s picture

sry, patch was against 6.x-1.3 version

TS79’s picture

Version: 6.x-2.0-beta3 » 6.x-1.3
chuckbar77’s picture

subscribing

mooffie’s picture

Amitai? Do you happen to be reading this? I'd like to know your thoughts on this.

On the one hand, I don't like this patch very much. I had the impression Flag already does the elegant thing, by exposing just (1) the flagging user and (2) the flagged item.

On the other hand, I just had a look at Rules and I see, for example, that when one posts a comment, the node author too is exposed. So it seems we too should follow this convention and expose everything we can (that is, the node author + comment author).

Issue #688318: Send an email with Rules to node author when flagged addressed the "node author" argument in a specific usage. But the solution does not help in my case.
[...]
I added a short patch [...] which extends flag rules integration [...] to achieve maximal flexiblity.

I'm curious. What does this patch make possible that wasn't possible before?

TS79’s picture

... sense: using same rules actions, where the user-object is required as input. e.g. send a (heartbeat) message to the author of the node/comment, if someone flags it...

quicksketch’s picture

Fago is now a Flag module maintainer, maybe he'll have time to review this patch? I tend to stay out of the Rules integration.

fago’s picture

Version: 6.x-1.3 » 6.x-1.x-dev
Status: Needs review » Needs work

@quicksketch: thanks for the pointer!

@issue:
Looks like a good addition to me. Fortunately this works with rules2 in D7 already, so we only have to care about 6.x here. Though I think we need a version for flag-2.x too if it should go into 1.x.

+        'label' => t('flagged comment') .' '. t('author'),

This should be a single t().

@testers:
Please test using all added variables and report whether it properly works for you!

TS79’s picture

happy new year of issue lifetime

chrislabeard’s picture

I've tried this patch, however I still don't have the flagged content's author as an option. And it was the 2.x dev patch

Thanks,
Chris

TS79’s picture

@chrislabeard: did you clear the cache? I have 2.x dev not running, but can't imagine, why this should not work.

chrislabeard’s picture

I've cleared my cache but just can't seem to get it to show up as a argument value.

Thanks,
Chris

TS79’s picture

sry, that it lasts so long, but I did not have any test env with flags 2.x dev until now.
now i created one and if you
1. create a node-flag [myflag]
2. create a rule for trigger "Node has been flagged under "[myflag]""
3. add the action System::"Send E-Mail to user"

You have two user to in selection:
- flagging user
- flagged content author

So all seems to work for flags 2.x dev (and Rules 6.x-1.3, which runs in my env) too.

@chrislabeard: don't know, whats wrong in your installation.

fago’s picture

Status: Needs review » Needs work

Code looks good to me now, there are some whitespace issues though:

+++ flag.inc	14 Sep 2011 08:36:47 -0000
@@ -1320,6 +1320,11 @@
+      ),      ¶

Trailing whitespaces.

+++ flag.inc	14 Sep 2011 08:36:47 -0000
@@ -1453,11 +1458,21 @@
+      ),       ¶

Trailing whitespaces.

+++ flag.inc	14 Sep 2011 08:36:47 -0000
@@ -1453,11 +1458,21 @@
+      )      ¶

Trailing whitespaces and missing comma.

TS79’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Status: Needs work » Needs review
StatusFileSize
new2.52 KB
fago’s picture

Status: Needs review » Fixed

thanks, committed to 6.x-2.x and 6.x-1.x.

quicksketch’s picture

Excellent, thanks fago.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

liliplanet’s picture

Discover that [flagged-node:author:mail] works (Drupal 7)