By vovan on
Hello
next code automatic create node
$node = array('type' => 'place');
$values['title'] = $name;
$values['body'] = $description;
$values['filed_place'] = $place
$values['name'] = "admin";
$s = drupal_execute('place_node_form', $values, $node);
filed_place defined by CCK. Node was created, but field_place not set. What the problem?
vovan
Comments
Other fields
Are the other fields in the form set correctly?
If this code is a snippet from your actual site, there are a couple of errors on the line in question.
filed_place - error.
filed_place - error. Thanks
I replace filed_place by field_place. Now when i write to field_place value "743", there is "7". Only first simbol.
CCK array
You misspelled 'field' in your code :)
First of all put a
var_dump($node);in your node.tpl.php, go to you cck node and check the actual field name. Usually cck fields have a nested array (even if they accept only one value) with key 'value' (and some others). I would try:
If this doesn't work, take a peek at what var_dump produces and experiment (or paste here). Wouldn't it be easier to pass all the data in the node object anyway? :)
--
Pielgrzym
It work,
It work, Thanks.
Drupal fareva!!!