Sunday 30 January 2005 10:37:43 am
Hi Gabriel! I haven't ever tried manually setting the "published" and so attributes, so I can't comment on your code. I think it would be easier if you, after storing the objectInstance, published it:
$operationResult = eZOperationHandler::execute( 'content', 'publish', array(
'object_id' => $newObjectInstance->attribute( 'id' ), 'version' => 1 ) );
If I were you, I'd take a look at the file /cronjobs/rssimport.php. In that file, you'll see one of the ways of adding objects to ez by code. You may also need to create a version 1 of the object:
$version =& $contentObject->version( 1 );
$version->setAttribute( 'status', EZ_VERSION_STATUS_DRAFT );
$version->store();
HTH, and have a nice day! :)
Cheers,
Sven Ryen
sven.ryen at maxus.no
|