1

The problem I have is that I am using a module called Trackfield that defined a CCK field for D6, I (inexpertly) ported the module to D7 to use the Field API. My port works great and I have been using it for over a year but I have recently wanted to set one of its values in Rules, but it isn't available in Rules. There are several other field types provided by this module and my port that also work fine but are not available in Rules.

I have tried setting conditions in the rules for 'entity type' and 'entity has field' to no avail. The field is listed for 'entity has field' but is not available as a data selector.

I have used the entity_metadata_wrapper() to test entities with a field provided by my module (field_foo) and the EMW does not see the field at $wrapper->field_foo but it is present on the node object at $wrapper->value(). All other field types on these entities are available as you would expect on the EMW object and as data selectors in rules, these include date, file, entity reference.

I have got to the point where I figure, seeing as all the fields provided by my module are not picked by the EMW, I must have missed declaring something through the field API that would allow my fields to be picked up automatically or that I have included some bad configuration somewhere that causes them to be discarded.

Thanks in advance for you time and thoughts, it is all very much appreciated.

  • Are you looking for this by any chance? – Clive Jan 2 '15 at 23:43
  • @Clive I think this is it, I added 'property_type' to my hook_field_info() definition and can now see the field in Rules. I may need to use a 'property_callback' as it is a multi db-column field but that is another day. Thank you. As you can see I am new to stackexchange, I would like to credit you for this but as this is not an 'Answer' how can I do that? – Honey Snow Jan 4 '15 at 15:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.