field_setValue()...

Events happening in the community are now at Drupal community events on www.drupal.org.
spinningbull's picture

I've been trying to figure out a generic way to set the value of CCK defined fields from my custom module code. Is there any form of a hook_field_setValue($item) or the like?

My module exposes an API to create content defined by CCK. I want to be able to take the inputs to the api function and "convert" them to well-formed CCK arrays. My hope would be this function would invoke the appropriate validate functions, etc... Is there such an animal?

At this point, I build the appropriate array in code to get the value set then pass it into node_save. It works ok, but bypasses the validation code defined by the field handler (doesn't it?).

Any thoughts?

Content Construction Kit (CCK)

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: