Posted by spinningbull on January 9, 2009 at 2:27am
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?