diff --git a/livesupport/modules/alib/var/m2tree.php b/livesupport/modules/alib/var/m2tree.php index c72678d9d..7fbb5ff1a 100644 --- a/livesupport/modules/alib/var/m2tree.php +++ b/livesupport/modules/alib/var/m2tree.php @@ -22,7 +22,7 @@ define('ALIBERR_MTREE', 10); * ); * * @author $Author: tomas $ - * @version $Revision: 1.4 $ + * @version $Revision: 1.5 $ * @see ObjClasses * Original author Tom Hlava */ @@ -276,7 +276,8 @@ class M2tree{ function getObjId($name, $parId=NULL) { if($name=='' && is_null($parId)) $name = $this->rootNodeName; - $parcond = (is_null($parId) ? "parid is null" : "parid='$parId'"); + $parcond = (is_null($parId) ? "parid is null" : + "parid='$parId' AND level=1"); $r = $this->dbc->getOne(" SELECT id FROM {$this->treeTable} t LEFT JOIN {$this->structTable} s ON id=objid