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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 18:15:58
Script start
Timing: Jan 18 2025 18:15:58
Module start 'layout'
Timing: Jan 18 2025 18:15:58
Module start 'content'
Timing: Jan 18 2025 18:15:59
Module end 'content'
Timing: Jan 18 2025 18:15:59
Script end

Main resources:

Total runtime0.8642 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 589.1641152.6406
Module start 'layout' 0.00600.0031 741.804739.4766
Module start 'content' 0.00910.8535 781.2813402.4609
Module end 'content' 0.86260.0016 1,183.74228.2813
Script end 0.8642  1,192.0234 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.3599160.0002
Check MTime0.00130.1554160.0001
Mysql Total
Database connection0.00110.122010.0011
Mysqli_queries0.823695.2966460.0179
Looping result0.00040.0482440.0000
Template Total0.833096.420.4165
Template load0.00180.213420.0009
Template processing0.831296.173620.4156
Template load and register function0.00020.022810.0002
states
state_id_array0.00080.090110.0008
state_identifier_array0.00170.202020.0009
Override
Cache load0.00140.1673130.0001
Sytem overhead
Fetch class attribute can translate value0.00070.078710.0007
Fetch class attribute name0.00130.152010.0013
XML
Image XML parsing0.00010.012810.0001
class_abstraction
Instantiating content class attribute0.00000.000710.0000
General
dbfile0.00110.1257100.0001
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 9
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs