Fix: some bugs and warnings

This commit is contained in:
Regis Houssin
2018-04-18 10:13:20 +02:00
parent d6680b982a
commit ff76e60c49
4 changed files with 26 additions and 20 deletions

View File

@@ -3923,23 +3923,26 @@ abstract class CommonObject
$var = true;
$i = 0;
foreach ($this->lines as $line)
if (! empty($this->lines))
{
if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line)))
foreach ($this->lines as $line)
{
if (empty($line->fk_parent_line))
if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line)))
{
$parameters=array('line'=>$line,'var'=>$var,'i'=>$i);
$action='';
$hookmanager->executeHooks('printOriginObjectLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (empty($line->fk_parent_line))
{
$parameters=array('line'=>$line,'var'=>$var,'i'=>$i);
$action='';
$hookmanager->executeHooks('printOriginObjectLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
}
}
else
{
$this->printOriginLine($line, $var, $restrictlist);
}
}
else
{
$this->printOriginLine($line, $var, $restrictlist);
}
$i++;
$i++;
}
}
}