I'm attempting to create a flag that will unpublish a comment when the flag is set on that comment.
I'm attempting to use Rules, Flag, and Rules Flag to achieve this.
The comment type is default 'comment' I'm calling the flag 'unpublish_publish' The flag is global
Where I get stuck is on the Actions portion of the rule creation. For the trigger event I have: After flagging a comment of type Default comments Machine name: rules_flag_entity_flagged:comment--comment
For condition, I have...
Entity is of type
Parameters: entity: comment, type: comment
For actions, I have... Set a data value Parameters: data: comment.status.value, value: 0
Something must be wrong. a) Where should I be identifying which flag is involved? There doesn't seem to be any way to do it under conditions. b) I get an error when the rule is enabled...
Drupal\flag\FlagService::getFlagging(): Argument #1 ($flag) must be of type Drupal\flag\FlagInterface, null given, called in ...modules/contrib/rules_flag/src/Plugin/Condition/EntityIsFlagged.php on line 57 in Drupal\flag\FlagService->getFlagging() (line 93 ...
Has anyone achieved this in D8+ and can straighten me out?