AnsweredAssumed Answered

what causes an instance of hook class to have no parameters?

Question asked by Francesca Shiekh on Mar 22, 2015
Latest reply on May 11, 2015 by gianluca poli
I am trying to debug a logic hook that is not working.
In the debug log I see it is "Creating new instance of hook class automated_case_handling without parameters" while all other logic hooks are with parameters. It would make sense that this too had params.
This is what the log looks like:

                Sun Mar 22 19:56:02 2015 [15569][1][DEBUG] Hook called: Cases::before_save
Sun Mar 22 19:56:02 2015 [15569][1][DEBUG] Including hook file: custom/modules/Cases/logic_hooks.php
Sun Mar 22 19:56:02 2015 [15569][1][DEBUG] Creating new instance of hook class WorkFlowHandler with parameters
Sun Mar 22 19:56:02 2015 [15569][1][DEBUG] Creating new instance of hook class automated_case_handling without parameters
Sun Mar 22 19:56:02 2015 [15569][1][DEBUG] Creating new instance of hook class update_log with parameters       


and this is my before_save in logic_hooks.php file:


$hook_version = 1;
$hook_array = Array();
$hook_array['before_save'] = Array(); 
$hook_array['before_save'][] = Array(1,'workflow','include/workflow/WorkFlowHandler.php','WorkFlowHandler','WorkFlowHandler'); 
$hook_array['before_save'][] = Array(2, 'before_save', 'custom/modules/Cases/automated_case_handling.php','automated_case_handling', 'before_save'); 
$hook_array['before_save'][] = Array(3,'update_log','custom/modules/Cases/update_log.php','update_log','update_log'); 

I have double checked the class and method and they are correct:

class automated_case_handling
function before_save ($bean,$event,$arguments)

I am probably missing something obvious but I can't see it... 
(The workflow handler was not added by me. It was there... I assume automatically generated at some point in our history.)

thanks,
FrancescaS

Outcomes