Start to clean hook code
This commit is contained in:
parent
1bff25bf28
commit
f67e52f42a
@ -47,6 +47,14 @@ For developers:
|
|||||||
- New: Make some changes to allow usage of several alternative $dolibarr_main_url_root variables.
|
- New: Make some changes to allow usage of several alternative $dolibarr_main_url_root variables.
|
||||||
Fix also several bugs with old code.
|
Fix also several bugs with old code.
|
||||||
|
|
||||||
|
WARNING: We started to clean hooks code. If your hook want to modify value of $actions, it's role
|
||||||
|
of your hook to modify it. Dolibarr hook code will not decide this for your module anymore.
|
||||||
|
If your action class for hook was returning a string or an array, instead your module must
|
||||||
|
set $actionclassinstance->results (to return array)
|
||||||
|
or $actionclassinstance->resprints (to return string)
|
||||||
|
to return same thing. The return value must be replaced by a "return 0";
|
||||||
|
Goal is to fix old compatibility code that does not match hook
|
||||||
|
specification: http://wiki.dolibarr.org/index.php/Hooks_system
|
||||||
|
|
||||||
***** ChangeLog for 3.4 compared to 3.3.2 *****
|
***** ChangeLog for 3.4 compared to 3.3.2 *****
|
||||||
For users:
|
For users:
|
||||||
|
|||||||
@ -183,7 +183,7 @@ class HookManager
|
|||||||
if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints;
|
if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints;
|
||||||
// TODO. remove this. array result must be set into $actionclassinstance->results
|
// TODO. remove this. array result must be set into $actionclassinstance->results
|
||||||
//if (is_array($result)) $this->resArray = array_merge($this->resArray, $result);
|
//if (is_array($result)) $this->resArray = array_merge($this->resArray, $result);
|
||||||
// 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->resprints to return a string
|
||||||
//if (! is_array($result) && ! is_numeric($result)) $this->resPrint.=$result;
|
//if (! is_array($result) && ! is_numeric($result)) $this->resPrint.=$result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user