I just realized that Rules (or Entity API) doesn't provide the status of a comment as a property to use in Rules. That's kind of inconvenient if you want to have rules with conditions on the comment status.

This is a feature request to _alter the declared properties for comments, and include comment status.

Comments

mitchell’s picture

Project: Rules Bonus Pack » Entity API
Component: Rules Bonus: Miscellaneous » Entity property wrapper
fago’s picture

Status: Active » Fixed

In the meantime that's already done:

  $properties['status'] = array(
    'label' => t("Status"),
    'description' => t("Whether the comment is published or unpublished."),
    'setter callback' => 'entity_property_verbatim_set',
    // Although the status is expected to be boolean, its schema suggests
    // it is an integer, so we follow the schema definition.
    'type' => 'integer',
    'options list' => 'entity_metadata_status_options_list',
    'setter permission' => 'administer comments',
    'schema field' => 'status',
  );

Status: Fixed » Closed (fixed)

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

boran’s picture

I wanted to change comment status to unpublished.

For information, incase others stumble on this post
- I updated to 7.x-1.0-rc3, but dont see a rule action in the GUI to alter entities (create/delete is there) or comments.
- In fact, all that needs to be done, is to "Set a data value" comment:status to "Unpublished" (e.g. on event is "After saving a new comment")