Wednesday 30 August 2006 11:41:42 am
Hello. Thanks for the info you sent. I reviewed the threads you referenced, and I'll try a few different things based on what I saw there. However, I don't think the problem is in the publish step (though I could be wrong). Here's the above code including the code I use to publish the object:
// Create and instantiate user object
// Then ...
$contentObjectAttributes = & $contentObject->contentObjectAttributes();
$contentObjectAttributes[0]->setAttribute('data_int', $attribute1);
$contentObjectAttributes[0]->store();
$contentObjectAttributes[1]->setAttribute('data_int', $attribute2);
$contentObjectAttributes[1]->store();
$userAccountObject = eZUser::fetch($contentObjectAttributes[2]->ContentObjectID);
$userAccountObject->setInformation($contentObject->attribute('id' ), $username, $email, $password, $confirmPassword);
$userAccountObject->store();
$contentObject->setAttribute('status', EZ_VERSION_STATUS_DRAFT);
$contentObject->store();
// Publish it
include_once ('lib/ezutils/classes/ezoperationhandler.php');
$operationResult = eZOperationHandler :: execute('content', 'publish', array (
'object_id' => $contentObject->attribute('id' ),
'version' => 1
));
// Send notification emails and redirect
The object seems to be published correctly. What's not working correctly is that attribute data is not being saved correctly. The only attribute that is saved correctly is the user account. Do I need to get the user account by reference (same as the contentObjectAttributes array)? Like this:
$userAccountObject = & eZUser::fetch($contentObjectAttributes[2]->ContentObjectID);
Regards,
Rob Pratt rpratt(at-sign)wordandsound.com
|