| Wednesday 19 July 2006 11:05:40 am 
                                                                
                                                                 Greetings everyone. I am trying to create a custom trigger that will run a workflow event before a content object is removed. The following code was added to /kernel/classes/operation_defenition.php 
$OperationList['remove'] = array ( 'name' => 'remove', 
				     	     'default_call_method' => array('kernel/content/ezcontentoperationcollection.php', 
                                                                  'class' => 'eZContentOperationCollection'), 
                                   'parameter_type' => 'standard', 
                                   'parameters' => array( array( 'name' => 'node_id', 
                                                                 'type' => 'integer', 
                                                                 'required' => true) ), 
                                   'keys' => array('node_id'), 
                                   'body' => array( array( 'type' => 'trigger', 
                                                           'name' => 'pre_remove', 
                                                           'keys' => array('object_id','version') ) )
					 ); 
The only thing I need to get executed is the actual trigger. Now the following code was added to /kernel/content/removeobject.php 
$operationResult = eZOperationHandler::execute( 'content', 'remove', array( 'node_id' => $contentNodeID ), null, TRUE); 
 I also modified workflow.ini so the trigger shows up in <eZ_url>/trigger/list by adding 
AvailableOperationList[]=content_remove
 When I am trying to delete something $operationResult = NULL and therefore nothing happens - the workflow doesnt get executed. What have I done wrong? |