The documentation for hook_validate() (see http://api.drupal.org/api/function/hook_validate/6) explains:
"If it is really necessary to change the node at the validate stage, you can use function form_set_value()."
The documentation for form_set_value() explains that form_set_value() has $form_state as third argument. $form_state is not an argument for hook_validate() and so without more knowledge unknown inside hook_validate().
Comments
Comment #1
dman commentedUm yeh. There is some inconsistancy there.
I believe that
hook_validate() is actually a version of {node_type}_validate() which validates whether a node is OK to save.
This is a bit different from form validation functions {formname}_validate() which the docs appear to be referring to, and does/should have the $form_state param.
It appears we have two different hook_validate() templates.
Or I'm also confused.
Needs clarification indeed.
Comment #2
brianV commentedThis inconsistency exists in both D6 and D7.
This documentation was perfectly valid for D5. In D5, form_set_value took $form as an argument rather than $form_state.
Comment #3
jhodgdonThis is a duplicate of #326564: hook_validate documentation suggests form_set_value(), but not possible