I have a Rule as follows (I simplified down to this for testing):

Events:
After saving a new comment
After updating an existing comment

Conditions:
Text comparison
Parameter: Text: [comment:comment-body:value], Matching text: bad, Comparison operation: regular expression

Actions:
Show a message on the site
Parameter: Message: Bad stuff here

And this works absolutely fine if the relevant Comment body field is set to "Filtered text" (in admin/structure/types/manage/[content-type]/comment/fields/comment_body). But if I set it to Plain text, nothing happens. I've tried all types of Text comparison operation but nothing ever happens so long as the type is Plain text. Unfortunately I have to have the Comment body set to Plain text so I can't work around the problem with the Filtered text option.

Is this a bug or am I missing something?!

Comments

one_orange_cat’s picture

Issue summary: View changes

slight improvement to layout of info!

Pauly Jura’s picture

I'm trying to do something similar where I check a comment for "bad text" in order to unpublish it. Turning on debugging shows this message:

0 ms Reacting on event After saving a new comment.
7.781 ms Evaluating conditions of rule Filter spam comments. [edit]
8.437 ms Unable to apply data selector comment:comment-body:value. The specified variable is not a list or a structure: Property comment_body.
8.804 ms Unable to evaluate condition text_matches. [edit]
8.822 ms AND evaluated to FALSE.
8.841 ms Finished reacting on event After saving a new comment.

My comments are all plain text also.

Would love to have this fixed soon.

ponies’s picture

This might be related. When I do a regex text comparison on node:body:value it works like a charm if the user selected 'Plain text', but fails if they use 'Filtered HTML'.

ponies’s picture

Issue summary: View changes

fix to path

TR’s picture

Version: 7.x-2.2 » 7.x-2.x-dev
Category: Bug report » Support request
Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)
Related issues: +#1281912: Access and Set Comment extra fields

Please read #1281912: Access and Set Comment extra fields - it explains the difference is structure of the comment object when the format is set to plain text vs filtered HTML, and it shows a rule export you can use to set the value of the comment body.

If that does not sufficiently address your problem, please provide more detail along with an export of your rule to show us exactly what you are trying.

TR’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

No further information provided.