Forums / General / Anyone else getting Fatal error in kernel/content/copy.php ?

Anyone else getting Fatal error in kernel/content/copy.php ?

Author Message

Rainer Krauss

Thursday 27 August 2009 8:05:41 am

Dear all,

I've got objects that are published at several different locations.

When I click on their copy button in the list of sub items of an object in the admin view, I get:

Fatal error: Call to a member function attribute() on a non-object in /www/cdu-phc/kernel/content/copy.php on line 155

Is anybody else experiencing this problem (as in could this be a bug)? - using eZ 4.1.0 here.

Best wishes,
Rainer

André R.

Thursday 27 August 2009 8:53:33 am

Whats on that line? (there is nothing at that line in 4.1.4 in svn)

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Rainer Krauss

Friday 28 August 2009 12:56:45 am

Thanks for asking, Andre.

In /www/cdu-phc/kernel/content/copy.php on line 155 is:

    $sourceParentNodeID = $node->attribute( 'parent_node_id' );

which is part of

 function browse( $Module, $object )

where $node is just the main_node of $object

In 4.1.4 it's line 157 and the browse function has not changed.

Best wishes,
Rainer

André R.

Friday 28 August 2009 4:40:41 am

So you have some db inconsistency then, since the object you are referring to doesn't have a valid main_node.

Try to echo the object id before that line using:

if ( !$node instanceof eZContentObjectTreeNode )
    echo 'object_id: ' . $objectID;

and check the database using:

SELECT *
FROM `ezcontentobject_tree`
WHERE `contentobject_id` =<object_Id>

And pay especially attention to "main_node_id", it should be same value on all.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom