Forums / Developer / publish an unpublished article using php

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

publish an unpublished article using php

Author Message

Sebastian Sprenger

Wednesday 04 February 2004 12:48:42 am

Hi all,
I try to publish an object via php. Using a workflow I unpublish it ($myObject->unpublish()).
Later I use another script to publish it:

$operationResult = eZOperationHandler::execute( 'content', 'publish',
array('object_id' => $objectId,
'version' => $aktVersion->Attribute("version")
) );

My problem: it works, but only after a reload of the page! First time, $operationResult returns the value 1, but the object is not published. Second time ist says 1 again, but the object is published now...

Thanks for any suggestions,
Sebastian