elegant module. yet, CCK is still incomlete.

I have a videoclip type content with a url CCK field.

the following code failed to update

$newNode = orm('videoclip')->create();
$newNode->setTitle('Show Mon Nov 30 2009 06:14:03 PM');
$newNode->body = 'body of text and other stuff';

$newNode->url = '123';
$newNode->save();

but the following workaround did work:

$newNode = orm('videoclip')->create();
$newNode->setTitle('Show Mon Nov 30 2009 06:14:03 PM');
$newNode->body = 'body of text and other stuff';

$newNode->field_url[0]['value'] = '123';
$newNode->save();

Comments

brendoncrawford’s picture

Liorm,

As you may notice, I have not added field mappers for the cck fields. What I am currently implementing would be a magic getter/setter, so in your example it would be something like:

$newNode->setUrl('123');

I am having a few problems with trying to implement this correctly, so it may take some time.

Thanks for your feedback