minor fix

This commit is contained in:
tomas 2005-05-12 00:44:28 +00:00
parent 99660726c4
commit e0629e61bf

View file

@ -22,7 +22,7 @@ define('ALIBERR_MTREE', 10);
* ); * );
* </code></pre> * </code></pre>
* @author $Author: tomas $ * @author $Author: tomas $
* @version $Revision: 1.4 $ * @version $Revision: 1.5 $
* @see ObjClasses * @see ObjClasses
* Original author Tom Hlava * Original author Tom Hlava
*/ */
@ -276,7 +276,8 @@ class M2tree{
function getObjId($name, $parId=NULL) function getObjId($name, $parId=NULL)
{ {
if($name=='' && is_null($parId)) $name = $this->rootNodeName; 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(" $r = $this->dbc->getOne("
SELECT id FROM {$this->treeTable} t SELECT id FROM {$this->treeTable} t
LEFT JOIN {$this->structTable} s ON id=objid LEFT JOIN {$this->structTable} s ON id=objid