From 242d06673af6a576612d7e57019f5e134403874d Mon Sep 17 00:00:00 2001 From: Deon George Date: Tue, 8 Sep 2009 15:38:49 +1000 Subject: [PATCH] SF Bug #2853633 - activating hooks gives error undefined constant DEBUG_ENABLE --- lib/hooks.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/hooks.php b/lib/hooks.php index cbdec09..57066ed 100644 --- a/lib/hooks.php +++ b/lib/hooks.php @@ -117,7 +117,7 @@ function run_hook($hook_name,$args) { * @param rollback_function Name of the php rollback function called upon failure. */ function add_hook($hook_name,$hook_function,$priority=0,$rollback_function=null) { - if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) + if (defined('DEBUG_ENABLED') && DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',257,0,__FILE__,__LINE__,__METHOD__,$fargs); # First, see if the hook function exists. @@ -153,7 +153,7 @@ function add_hook($hook_name,$hook_function,$priority=0,$rollback_function=null) * procedures that call this function as a rollback will be removed. */ function remove_hook($hook_name,$hook_function,$priority,$rollback_function) { - if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) + if (defined('DEBUG_ENABLED') && DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',257,0,__FILE__,__LINE__,__METHOD__,$fargs); if (array_key_exists($hook_name,$_SESSION[APPCONFIG]->hooks)) {