[development] How to validate a $node?

Moshe Weitzman weitzman at tejasa.com
Wed Jun 7 03:07:39 UTC 2006


> - how does one validate a node programmatically *correctly*?
> - what is the point of the "node_validate()" function and the hooks if 
> it doesn't actually *validate* the node at all? At least rename it to 
> "node_noop()" so things are clear.
> - really, why have "node_validate()" at all? Does anyone do anything 
> usefull in it?

good question.

unfortunately, 4.7 is a bit of an intermediate solution which makes this 
hard. the conceptual way to do is is to programtically "submit" the story 
form. In 4.7, this amounts to populating the proper $_POST variables like 
'type' and 'title' and so on and then building the node form by calling the 
right functions and then calling drupal_get_form(). the node form is the 
most complex of all our forms so i'm not sure this works right.

form api 2.0 will be focused on making things like this easy again.

-moshe


More information about the development mailing list