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.