Author Topic

Tobias Schirski

Thursday 30 October 2008 3:06:47 am

Comment50318

Hi André,

thanks for your kind reply.

Here you go with (hopefully) all needed informations:

First of all, I´m using Exponential <b>4.0.1</b>

I´ve built an ezP-Module, which is used to administrate certain data, which cannot be handled by the ezP-Backend.

So this function will be called within a running ezP-Enviroment, which means, I guess, that I don´t have to bother with eZScript and eZCli and all that stuff. At least, I hope so.

So this is, what I do in my module:

//Get Draft-Object with ID 183
$draft = eZContentObject::fetch(183);
		
//Copy Draft-Object to new Object
$newObject = $draft->copy(false);
$newObject->setAttribute( 'remote_id', $remoteId);
$newObject->store();
		
// Assign new object to node 180
$nodeAssignment = eZNodeAssignment::create(
		    array(
		        'contentobject_id'		=> $newObject->attribute( 'id' ),
		        'contentobject_version'	=> 1,
		        'parent_node' => 180,
		        'is_main' => 1
		        )
		    );

//Store this Node-Assignment
if( $nodeAssignment )
{
	$nodeAssignment->store();
}
		
	
//Get the objects Version
$objectVersion = $newObject->currentVersion();
		

//Now set the Attribute 'name' to a new Value
$attributes = $objectVersion->attribute('data_map');
		
		
$name = $attributes['name'];
$name->fromString('New Value!');
$name->store();
		
//Store object again
$newObject->store();
		

//Publish new Object
$result = eZOperationHandler::execute('content', 'publish', array('object_id' => $newObject->attribute( 'id' ), 'version' =>  $objectVersion->attribute('version')));

Now this code always produces the above stated Error-Message. The Object, however, will be published and everything seems fine, so far.

Here´s the function, the Error-Message references to (to be found in ezfsfilehandler.php):

    function fileDeleteByDirList( $dirList, $commonPath, $commonSuffix )
    {
        $dirs = implode( ',', $dirList );
        $wildcard = $commonPath .'/{' . $dirs . '}/' . $commonSuffix . '*';

        eZDebugSetting::writeDebug( 'kernel-clustering', "fs::fileDeleteByDirList( '$dirList', '$commonPath', '$commonSuffix' )" );

        eZDebug::accumulatorStart( 'dbfile', false, 'dbfile' );
        array_map( 'unlink', eZSys::globBrace( $wildcard ) );
        eZDebug::accumulatorStop( 'dbfile' );
    }

Now, I hope, this is all information you need.

Thank you again and bye!

Tobias