From 5f2af003977831539a5b495e883b9865de710271 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 Jan 2013 00:24:20 +0100 Subject: [PATCH] Add logs to debug --- htdocs/core/class/hookmanager.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index c6e5895f450..753086339fb 100755 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -117,7 +117,7 @@ class HookManager * @param Object &$object Object to use hooks on * @param string &$action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...) * @return mixed For doActions,formObjectOptions: Return 0 if we want to keep standard actions, >0 if if want to stop standard actions, <0 means KO. - * For printSearchForm,printLeftBlock,printTopRightMenu,formAddObjectLine,...: Return HTML string. TODO Must always return an int and things to print into ->resprints. + * For printSearchForm,printLeftBlock,printTopRightMenu,formAddObjectLine,...: Return HTML string. TODO Must always return an int and things to print into ->resprints. * Can also return some values into an array ->results. * $this->error or this->errors are also defined by class called by this function if error. */ @@ -176,11 +176,13 @@ class HookManager // TODO. remove this. result must not be a string. we must use $actionclassinstance->resprint to return a string if (! is_array($result) && ! is_numeric($result)) $this->resPrint.=$result; } + + //print "method=".$method." results=".count($actionclassinstance->results)." resprints=".count($actionclassinstance->resprints)." result=".$result." resaction=".$resaction; } } } - if ($method != 'doActions' && $method != 'formObjectOptions') return $this->resPrint; // TODO remove this. When there is something to print, ->resPrint is filled. + if ($method != 'doActions' && $method != 'formObjectOptions') return $this->resPrint; // TODO remove this. When there is something to print, ->resPrint is filled. return ($error?-1:$resaction); }