Share » Forums » Developer » How to making a new delating trigger?

How to making a new delating trigger?

How to making a new delating trigger?

Thursday 12 January 2006 8:48:51 am - 3 replies

Author Message

christian bencivenni

Friday 13 January 2006 2:32:05 am

I append this lines to operation_definition.php file in kernel/content/:

$OperationList['canceltrigger'] = array (						               'name' => 'canceltrigger',
	               'default_call_method'=> 'kernel/content/ezcontentoperationcollection.php',
	               'class' => 'ezcontentoperationcollection',
	               'parameter_type' => 'standard',
	               'parameters' => array(	
                                 array( 
		 'name' => 'object_id',
		 'type' => 'integer',
		 'required' => true),
	                 array( 
		 'name' => 'version',
		 'type' => 'integer',
		 'required' => true)),
	'keys' => array('object_id'),
	'body' => array(
		array(
			'type' => 'trigger',
			'name' => 'pre_cancel',
			'keys' => array('object_id','version')),
		array(
			'type' => 'method',
			'name' => 'removeOldNodes',
			'frequency' => 'once',
			'method' => 'removeOldNodes' )));

Is it correct?
Then I have an event where modify my personal DB table.
The only deleting function I found is removeOldNodes($idobject, $version) in the ezcontentoperationcollection class.
But when I delete an object from the admin_view nothing appens.
Where is the error?

christian bencivenni

Monday 16 January 2006 1:02:04 am

No one can help me?
Jeez...

Kåre Køhler Høvik

Monday 16 January 2006 1:33:01 am

Hi

You need to add to : kernel/content/removeobject.php

    $operationResult = eZOperationHandler::execute( 'content', 'canceltrigger', array( 'object_id' => $contentObjectID ), null, $useTriggers );

You should also remove version ID from the operation definition.

Override workflow.ini with ( to list it in <eZ_url>/trigger/list ):

[OperationSettings]
AvailableOperations=content_publish;before_shop_confirmorder;shop_checkout;content_canceltrigger

Kåre Høvik

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu