done as it should
This commit is contained in:
parent
586d496d5a
commit
2d60fe26f9
@ -4682,16 +4682,10 @@ class Product extends CommonObject
|
|||||||
while ($rec = $this->db->fetch_array($res)) {
|
while ($rec = $this->db->fetch_array($res)) {
|
||||||
if (!empty($alreadyfound[$rec['rowid']])) {
|
if (!empty($alreadyfound[$rec['rowid']])) {
|
||||||
dol_syslog(get_class($this).'::getChildsArbo the product id='.$rec['rowid'].' was already found at a higher level in tree. We discard to avoid infinite loop', LOG_WARNING);
|
dol_syslog(get_class($this).'::getChildsArbo the product id='.$rec['rowid'].' was already found at a higher level in tree. We discard to avoid infinite loop', LOG_WARNING);
|
||||||
$hasParentInSamePath = false;
|
if (in_array($rec['id'], $parents)) {
|
||||||
for ($i = 0; $i < count($parents); $i++) {
|
|
||||||
if ($parents[$i] == $rec['id']) {
|
|
||||||
$hasParentInSamePath = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($hasParentInSamePath)
|
|
||||||
continue; // We discard this child if it is already found at a higher level in tree in the same branch.
|
continue; // We discard this child if it is already found at a higher level in tree in the same branch.
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$alreadyfound[$rec['rowid']] = 1;
|
$alreadyfound[$rec['rowid']] = 1;
|
||||||
$prods[$rec['rowid']] = array(
|
$prods[$rec['rowid']] = array(
|
||||||
0=>$rec['rowid'],
|
0=>$rec['rowid'],
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user