diff --git a/ChangeLog b/ChangeLog index c477a17d684..66bccd31c06 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,16 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 15.0.0 compared to 14.0.0 ***** + +For developers: +--------------- + +WARNING: + +Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: +* Update hook 'printOriginObjectLine', removed check on product type and special code. Need now reshook. + ***** ChangeLog for 14.0.0 compared to 13.0.0 ***** For users: diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 36df3b1a7b9..c13d8130774 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4805,13 +4805,18 @@ abstract class CommonObject if (!empty($this->lines)) { foreach ($this->lines as $line) { - if (is_object($hookmanager) && (($line->product_type == 9 && !empty($line->special_code)) || !empty($line->fk_parent_line))) { + $reshook = 0; + //if (is_object($hookmanager) && (($line->product_type == 9 && !empty($line->special_code)) || !empty($line->fk_parent_line))) { + if (is_object($hookmanager)) { // Old code is commented on preceding line. if (empty($line->fk_parent_line)) { - $parameters = array('line'=>$line, 'i'=>$i); - $action = ''; - $hookmanager->executeHooks('printOriginObjectLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + $parameters = array('line'=>$line, 'i'=>$i, 'restrictlist'=>$restrictlist, 'selectedLines'=> $selectedLines); + $reshook = $hookmanager->executeHooks('printOriginObjectLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + } else { + $parameters = array('line'=>$line, 'i'=>$i, 'restrictlist'=>$restrictlist, 'selectedLines'=> $selectedLines, 'fk_parent_line'=>$line->fk_parent_line); + $reshook = $hookmanager->executeHooks('printOriginObjectSubLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks } - } else { + } + if (empty($reshook)) { $this->printOriginLine($line, '', $restrictlist, '/core/tpl', $selectedLines); }