Add logs to debug

This commit is contained in:
Laurent Destailleur 2013-01-23 00:24:20 +01:00
parent 06a0da990b
commit 5f2af00397

View File

@ -117,7 +117,7 @@ class HookManager
* @param Object &$object Object to use hooks on * @param Object &$object Object to use hooks on
* @param string &$action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...) * @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. * @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. * 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. * $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 // 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; 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); return ($error?-1:$resaction);
} }