Adding property_callbacks to hook_field_info allows safeword to work with entity_metadata_wrapper() and rules.module.

Comments

gabrielmachadosantos’s picture

Status: Active » Needs review
StatusFileSize
new1.72 KB

- Added the property type on hook_field_info();
- Created custom callback function that will provide the extra metadata required.

gabrielmachadosantos’s picture

Resubmitting, sorry I posted the wrong version of the patch. Please, disregard the patch above.

skwashd’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

skwashd’s picture

Title: Add support for entity_metadata_wrapper » Add property_callbacks to hook_field_info()
Issue summary: View changes
Status: Reviewed & tested by the community » Needs review
StatusFileSize
new2.11 KB

Rerolled so now it also supports rules and not just entity_metadata_wrapper().

skwashd’s picture

In rules it is possible to reference field values in rules actions or conditions.

For example I have a project node type, which has a entity reference to a client node. That client node has a client code field which is using safeword. I could have an email list which is [client-code]@example.com and configure rules so every time something happens on the project node it sends an email to that email address.

I am struggling to come up with a better example that isn't directly derived from my client's direct use case.

budalokko’s picture

Patch in #4 worked great for me on entity_metadata_wrapper().

robert castelo’s picture

Assigned: Unassigned » robert castelo
Status: Needs review » Fixed

Thanks, good patch!

Added to Safeword 7.x-1.5

Status: Fixed » Closed (fixed)

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