I wrote the following custom PHP code to create a node
<?php
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
global $user;
$title1=$node->title;
$node = new stdClass;
$node->type = 'Campaign_PlayerList';
$node->title = $title1;
$node->uid = $user->uid;
$node->language='und';
$node->field_cmp_playerid['und'][0]['value']=$user->uid;
$node->field_cmp_userscore['und'][0]['value']=1;
$node->field_cmp_usersupport['und'][0]['value']=1;
node_object_prepare($node);
node_save($node);
?>
The values for field_cmp_playerid
and field_cmp_attend_time
are not saved.
$node->field_cmp_playerid['und'][0]['value']=$user->uid;
doesnt work and field_cmp_attend_time
is the same too.
What could the problem be?
Here is a screenshot of the field management form for the Campaign Playerlist content type: