I am programmatically creating many nodes. Obviously they have to be valid before storing them. Such
$node objects have CCK fields mixed with custom fields.
Because the validators only set a
form_set_error() and hardly ever return the validation-result, I have to go trough the form-api in order to know if a node is valid, or so it seems.
There appear to be several problems with this approach:
form_set_error()sets a message with
drupal_set_message(); for stuff like cron (a session-less user), this adds orphaned persistent error-messages to the database (they will never be printed, hence never deleted).
- the returning array of errors is created to be used in a multidimensional form array. Especially with CCK-fields, I have to dig quite deep in order to find the actual error.
- I just want to store a node, so I am not interested in a user-faced form; using the form API just feels wrong.
Is there a simpler, more elegant method?