Remove strange check on hook printOriginObjectLine.

Now need reshook.
This commit is contained in:
Francis Appels 2021-08-09 11:17:11 +02:00
parent 4c3c613568
commit 91ef2a44fd
2 changed files with 20 additions and 5 deletions

View File

@ -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:

View File

@ -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);
}