httpd crash on inserting content

Author Message

Michael de Vries

Thursday 19 February 2009 1:21:30 am

Hi all!

I'm trying to write a soap plugin for eZ Publish, so I can publish content to eZ from another content system.
Except for not finding a lot of documentation about how to do this it is coming along fine.

So, what I have done until now:
I wrote a plugin which uses soap, this is working fine, I can talk to eZ, fetch objects and even put some stuff in.
But now I am at the point where I want to add an article to the system. If I try this with the code below, my httpd process crashes, no errors are written to the system or eZ publish log.

The code I use is the following:

initialize.php

<?php
// in extensions/my_soap_extension/soap/initialize.php

$server->registerFunction("createObject", array("title" => "string", "short_title" => "string", "intro" => "string", "body" => "string", "enable_comments" => "boolean", "username" => "string", "password" => "string"));

function createObject($title, $short_title, $intro, $body, $enable_comments, $username, $password){
	$user = checkUser($username, $password);

	if(!$user){
		return new eZSOAPFault("1", "Access denied, check username and password");
	}

	// Fetch parent node
	$parentNodeId = 2; //Main eZ Publish Node
	$parentNode =& eZContentObjectTreeNode::fetch($parentNodeId); //make a copy of the parent node
	
	if(!is_object($parentNode)){
		//if we come here, then parent node is a fake!
		return new eZSOAPFault("1", "Parent node doesn't exist!");
	}

	//fetch some useful variables
	$parentContentObject =& $parentNode->attribute("object");
	$sectionId = $parentContentObject->attribute("section_id");
	$userId =& $user->attribute("contentobject_id");
	
	//fetch class (article)
	$contentClass =& eZContentClass::fetchByIdentifier("Article");
	if(!is_object($contentClass)){
		//the contentclass doesn't exist, abort mission
		return new eZSOAPFault("1", "Article ContentClass doesn't exist!");
	}
	
	//create new ContentObject of this ContentClass
	$contentObject =& $contentClass->instantiate($userId, $sectionId);
}
?>

So, when I run this code, the httpd process crashes and after some investigation it seems to come from the following statement:

$contentClass->instantiate($userId, $sectionId);

This functions calls the following function:

$object->setName( ezi18n( "kernel/contentclass", "New %1", null, array( $this->name( $languageCode ) ) ), false, $languageCode );

And in this setName function there is the following line:

$backtrace = debug_backtrace();

When I remove that line, everything goes fine, no error or crashes occur. Zend Studio says the line is useless, because the $backtrace variable is never used, so why is this line there and why does it crash on that line?

Ole Marius Smestad

Thursday 19 February 2009 2:28:38 am

Hi,

that backtrace should not be there, it is removed for the upcoming versions.

http://issues.ez.no/14499


--
Ole Marius Smestad
Lead Engineer eZ Publish
Member of the Community Project Board

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 00:55:38
Script start
Timing: Jan 30 2025 00:55:38
Module start 'layout'
Timing: Jan 30 2025 00:55:38
Module start 'content'
Timing: Jan 30 2025 00:55:38
Module end 'content'
Timing: Jan 30 2025 00:55:38
Script end

Main resources:

Total runtime0.0142 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 588.1406151.2109
Module start 'layout' 0.00460.0021 739.351636.6484
Module start 'content' 0.00670.0063 776.000090.1719
Module end 'content' 0.01290.0013 866.171933.9922
Script end 0.0142  900.1641 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002316.2969140.0002
Check MTime0.00107.3427140.0001
Mysql Total
Database connection0.00096.598110.0009
Mysqli_queries0.001812.893230.0006
Looping result0.00000.070310.0000
Template Total0.00106.910.0010
Template load0.00085.523810.0008
Template processing0.00021.318610.0002
Override
Cache load0.00064.134910.0006
General
dbfile0.002618.080780.0003
String conversion0.00000.056940.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