I have a custom node-creation form for which I have my own validation function. How can I make sure that after my validation function the form goes through the same validation that it would have done on the original node-creation form?
Some thing like node_validate
looks like the kind of thing I need, but it works on $node
objects rather than forms.
The order of operations I perceive to be the best is
- On submit run custom validation
- If custom validation passes run the normal node validation
- If node validation succeeds insert values in the database
Is that a good and Drupal way?
node_validate()
is useless on a custom form because the errors get displayed but aren't acted on. There doesn't seem to be a way to catch the errors, even withform_get_errors()
. – htoip Jun 20 '12 at 12:53