You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: htdocs/comm/action/list.php
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -461,6 +461,12 @@
461
461
if ($usergroup > 0) {
462
462
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
463
463
}
464
+
465
+
// Add table from hooks
466
+
$parameters = array();
467
+
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
468
+
$sql .= $hookmanager->resPrint;
469
+
464
470
$sql .= " WHERE a.entity IN (".getEntity('agenda').")";
$alreadyfound = array($id => 1); // We init array of found object to start of tree, so if we found it later (should not happened), we stop immediately
5221
-
}
5222
5217
// Protection against infinite loop
5223
5218
if ($level > 30) {
5224
5219
returnarray();
@@ -5227,14 +5222,16 @@ public function getChildsArbo($id, $firstlevelonly = 0, $level = 1, $parents = a
5227
5222
$res = $this->db->query($sql);
5228
5223
if ($res) {
5229
5224
$prods = array();
5225
+
if ($this->db->num_rows($res) > 0) {
5226
+
$parents[] = $id;
5227
+
}
5228
+
5230
5229
while ($rec = $this->db->fetch_array($res)) {
5231
-
if (!empty($alreadyfound[$rec['rowid']])) {
5230
+
if (in_array($rec['id'], $parents)) {
5232
5231
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);
5233
-
if (in_array($rec['id'], $parents)) {
5234
-
continue; // We discard this child if it is already found at a higher level in tree in the same branch.
5235
-
}
5232
+
continue; // We discard this child if it is already found at a higher level in tree in the same branch.
5236
5233
}
5237
-
$alreadyfound[$rec['rowid']] = 1;
5234
+
5238
5235
$prods[$rec['rowid']] = array(
5239
5236
0 => $rec['rowid'],
5240
5237
1 => $rec['qty'],
@@ -5248,7 +5245,6 @@ public function getChildsArbo($id, $firstlevelonly = 0, $level = 1, $parents = a
0 commit comments