what am I doing wrong?

Author Message

Tomek Klaudel

Monday 12 July 2004 3:26:45 am

    $node =& eZContentObjectTreeNode::fetch( $target );
    $subTree =& $node->subTree( array ( 'Depth' => 1 ) );

from second line i got :
<i>Call to a member function on a non-object</i>

Paul Borgermans

Monday 12 July 2004 12:46:40 pm

Hard to tell, we need the lines before that too ($node is obviously not set)

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Tomek Klaudel

Monday 12 July 2004 2:04:33 pm

thanks for reply, here is rest of code:

<?
include_once( 'lib/ezsoap/classes/ezsoapserver.php' );
include_once( 'kernel/classes/ezcontentobjecttreenode.php' );

$server = new eZSOAPServer();
$server->registerFunction( "getContent", array ("arg0" => "string") );
$server->processRequest();

 function getContent( $target )
 {
     $node =& eZContentObjectTreeNode::fetch( $target );
     $subTree =& $node->subTree( array ( 'Depth' => 1 ) );
     $entries = array();
     foreach ( $subTree as $someNode )     {
         $entries[] = getNodeInfo( $someNode );
     }
     $thisNodeInfo = array ();
     $thisNodeInfo = getNodeInfo( $node );
     $thisNodeInfo["href"] = $_SERVER['SCRIPT_URI'];
     $entries[] = $thisNodeInfo;
  	 return $entries;
}
?>

I need something else to include? Or something to delete...
I'm calling this method with taget variable set to 2 (root node).

Kåre Køhler Høvik

Tuesday 13 July 2004 12:19:10 am

Hi

What to check :
- What value does the parameter $target have ?
- Where is getNodeInfo defined ?

--
Kåre Høvik

Kåre Høvik

Tomek Klaudel

Tuesday 13 July 2004 12:42:01 am

- What value does the parameter $target have ?

2

- Where is getNodeInfo defined ?

to simplify question I commented lines :

//     foreach ( $subTree as $someNode )     {
         //$entries[] = getNodeInfo( $someNode );
//     }
     //$thisNodeInfo = array ();
     //$thisNodeInfo = getNodeInfo( $node );
     //$thisNodeInfo["href"] = $_SERVER['SCRIPT_URI'];
     //$entries[] = $thisNodeInfo;

and I got again "Call to a member function on a non-object".
Propably I didn't initialized some variables, but I dont know what I need to initialize...
In docs i don't found anything on this, also in the book.

Tomek Klaudel

Wednesday 14 July 2004 9:11:51 am

Ok, I found that this is becouuse I not set sitedesign/siteaccess.
So maybe someone know what is the proper way to do it?

Greetings
Tomek

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 31 2025 01:14:55
Script start
Timing: Jan 31 2025 01:14:55
Module start 'layout'
Timing: Jan 31 2025 01:14:55
Module start 'content'
Timing: Jan 31 2025 01:14:55
Module end 'content'
Timing: Jan 31 2025 01:14:55
Script end

Main resources:

Total runtime0.0272 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 588.1094151.1953
Module start 'layout' 0.00560.0041 739.3047220.6563
Module start 'content' 0.00970.0156 959.96091,001.8984
Module end 'content' 0.02540.0017 1,961.859437.9922
Script end 0.0271  1,999.8516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003011.1126140.0002
Check MTime0.00124.2729140.0001
Mysql Total
Database connection0.00093.395710.0009
Mysqli_queries0.00186.706230.0006
Looping result0.00000.073810.0000
Template Total0.00134.610.0013
Template load0.00103.716210.0010
Template processing0.00020.899210.0002
Override
Cache load0.00072.578210.0007
General
dbfile0.00134.930680.0002
String conversion0.00000.036940.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