AnsweredAssumed Answered

SugarCRM 6.5.14 before_save logic hook does not trigger

Question asked by Kashif Abbasi on Mar 14, 2014
Latest reply on Mar 14, 2014 by Kashif Abbasi
I have used logic hooks before and working perfectly. But this one doesn't call the function of logic hook. 
Any help will be highly appreciated.

My logic_hook.php seems like this.

<?php
// Do not store anything in this file that is not part of the array or the hook version.  This file will
// be automatically rebuilt in the future. 
 $hook_version = 1; 
$hook_array = Array(); 
// position, file, function 
$hook_array['before_save'] = Array();
$hook_array['before_save'][] = Array(1, 'Test', 'custom/modules/Campaigns/test_hook.php','Test', 'Test');   
$hook_array['before_delete'] = Array(); 
$hook_array['after_ui_frame'] = Array();
//add_code_hook 
$hook_array['after_save'] = Array(); 

My Logic Hook file test_hook.php seems like this:


<?php
ini_set('display_startup_errors',1);
ini_set('display_errors',1);
error_reporting(-1);
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

class Test {
$GLOBALS['log']->debug("Class Test ".$event);
function Test(&$bean, $event, $arguments)
{
  $GLOBALS['log']->debug("Method Test ".$event);  
}
//echo 'sdfasdfasdf';
}
die('Test Here');
?>
I try to debug but i am only getting blank page no error nothing. Only thing i get is last die() i.e. "Test Here" if i remove all debug/log code from the class and function.

Please help me out on this issue. Thank you very much

Outcomes