[development] programmatically creating a node type.
Augustin (Beginner)
drupal.beginner at wechange.org
Thu Sep 7 05:48:08 UTC 2006
Hi,
following the examples in form.inc, I managed to programmatically create a new
user (the import robot) and some new nodes.
Now I would like to create a node type for that robot user to post its nodes.
My question is how do I guess which arguments to call drupal_execute() with?
for the form id, I look at the html source:
<input type="hidden" name="form_id" id="edit-node-type-form"
value="node_type_form" />
so I do:
$values['name'] = 'node type test';
$values['type'] = 'node_type_test';
$values['description'] = 'my description.';
$values['comment'] = 0;
drupal_execute('node_type_form', $values);
but I get:
warning: call_user_func_array(): First argumented is expected to be a valid
callback, 'node_type_form' was given in /includes/form.inc on line 181.
I don't understand: the
function node_type_form($type = NULL) {
exists in:
modules/node/content_types.inc
Is this a bug?
What am I doing wrong?
Augustin.
--
http://www.wechange.org/
Because we and the world need to change.
http://www.reuniting.info/
Intimate Relationships, peace and harmony in the couple.
More information about the development
mailing list