I am using the Reply module for comment threads on a custom entity (we'll call it myentity
). I'd like to create a rule that triggers when certain properties of myentity
are met. However, the Reply module has very minimal entity_property_info
, and so there's no way for rules to reference myentity
in a condition.
The Reply module creates a Reply entity, that references an entity via entity_id column and an entity_type column. So, I created a property_info_alter
hook as follows:
function mymodule_entity_property_info_alter(&$info) {
$properties = &$info['reply']['properties'];
$properties['entity_id'] = array(
'label' => t("Entity id"),
'description' => t("The entity this reply is associated with."),
'type' => 'entity',
'getter callback' => 'entity_property_verbatim_get',
'required' => TRUE,
'schema field' => 'entity_id',
);
}
When I create a condition in rules of "Entity is of Type", I expect to find my new property as an option like reply:entity-id
but it doesn't. It only appears in the condition "Data Comparison".
I feel like I'm missing something very simple, but really can't put my finger on it. How do I get this property to appear as a referenced entity that I can then evaluate in Rules?