I am attempting to place a value in a hidden CCK field using the nodeapi presave hook. My code allows me to change the contents of the node title and body in the main node record, but I cnnot seem to impact any CCK fields.
$node->title = 'chicadog';//works
$node->field_frid = '123';//fails
$node->field_frid_value = '123';//fails
$node->field_frid['#value'] = '123';//fails
$node->field_frid['value] = '123';//fails
$node->field_frid[0]['#value'] = '123';//fails
print_r($node) cant supply me with any info
Hoping soneone out there in the Drupal Nation can
[01-Mar-2011 16:28:09] PHP Fatal error: Cannot unset string offsets in /Applications/MAMP/htdocs/docroot/profiles/drupal_commons/modules/contrib/cck/content.module on line 1248
Comments
In order to make changes to
In order to make changes to CCK fields, you need to set the weight of your module higher than CCK, otherwise, the fields are not there yet. You can do that on the system table. I am still having some trouble because presave seems to be executed MORE than once.