MainNodeId not populated

Author Message

Alexandre Abric

Tuesday 22 November 2005 2:14:31 am

Hi,

I have written a very simple cronjob script with the following code :

$objectID = 249;
$object =& eZContentObject::fetch( $objectID );
print_r($object);

To my surprise, the variable MainNodeId of the object does not get populated, and this causes the code that follows to crash. Am I missing an include statement ? Here is the bunch of classes I imported :

include_once( 'kernel/classes/ezworkflowtype.php' );
include_once( 'lib/ezdb/classes/ezdb.php' );
include_once( 'kernel/classes/ezcontentobject.php' );
include_once( 'kernel/classes/ezcontentobjecttreenode.php' );
include_once( 'kernel/classes/ezcontentbrowse.php' );
include_once( 'kernel/classes/ezcontentbrowsebookmark.php' );
include_once( 'kernel/classes/ezcontentclass.php' );
include_once( "lib/ezutils/classes/ezhttptool.php" );
include_once( 'lib/ezdb/classes/ezdb.php' );
include_once( 'lib/ezutils/classes/ezoperationhandler.php' );
include_once( "kernel/classes/ezcontentclassattribute.php" );

Using eZ 3.7.1 and PHP 4.4.0

Thanks

Alexandre Abric

Tuesday 22 November 2005 3:09:46 am

OK : changing the code to :

$objectID = 249;
$object =& eZContentObject::fetch( $objectID );
$mainNodeID = $object->attribute( 'main_node_id' );
print_r($object);

now populates MainNodeID in the print_r ... bug or feature ?

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 30 2025 21:44:36
Script start
Timing: Jan 30 2025 21:44:36
Module start 'layout'
Timing: Jan 30 2025 21:44:36
Module start 'content'
Timing: Jan 30 2025 21:44:36
Module end 'content'
Timing: Jan 30 2025 21:44:36
Script end

Main resources:

Total runtime0.0273 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 589.2656151.2109
Module start 'layout' 0.00660.0056 740.4766220.6875
Module start 'content' 0.01220.0132 961.1641997.7109
Module end 'content' 0.02540.0019 1,958.875029.9922
Script end 0.0273  1,988.8672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003512.8995140.0003
Check MTime0.00176.3633140.0001
Mysql Total
Database connection0.00082.801510.0008
Mysqli_queries0.004717.319530.0016
Looping result0.00000.047110.0000
Template Total0.00155.410.0015
Template load0.00134.723010.0013
Template processing0.00020.692310.0002
Override
Cache load0.00103.786210.0010
General
dbfile0.00197.055680.0002
String conversion0.00000.041040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs