[development] Node limbo
Scott Reynen
scott at makedatamakesense.com
Sun Apr 24 21:22:55 UTC 2011
On 4/24/11 2:47 PM, jeff at ayendesigns.com wrote:
> I can't add the data to the node_term table until the save is
> complete...but I don't know how to move the data along to that point. I
> can put a submit handler before the normal one, and that gives me access
> to the data via the form, but by the time I get to where hook_nodeapi op
> pre_save would fire, there is no form and that field info won't be
> present in the node.
I went through the same thought process once, and was pleasantly
surprised to find the field info actually is present in the node. The
node object is created directly from $form_state['values'], so the $node
itself in hook_nodeapi() will contain the values you added to the form.
For example, if you added a field named 'something' with
hook_form_alter(), you'll see that in $form_state['values']['something']
in a form submit handler, and you'll see the same value in
$node->something in hook_nodeapi().
--
Scott Reynen
MakeDataMakeSense.com
More information about the development
mailing list