From 800bfd9f84b3f0d7e46ed6d5c372c08050c45a7c Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Fri, 19 Feb 2010 09:00:29 +0000 Subject: [PATCH] * fix the error when parent module doesn't exits. --- trunk/module/tree/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/trunk/module/tree/model.php b/trunk/module/tree/model.php index 503bb61616..458f24a5d3 100644 --- a/trunk/module/tree/model.php +++ b/trunk/module/tree/model.php @@ -192,6 +192,7 @@ class treeModel extends model $sql = "SELECT path FROM " . TABLE_MODULE . " WHERE id = '$moduleID'"; $path = $this->dbh->query($sql)->fetchColumn(); $path = substr($path, 1, -1); + if(!$path) return array(); $sql = "SELECT * FROM " . TABLE_MODULE . " WHERE id IN($path) ORDER BY grade"; $parents = $this->dbh->query($sql)->fetchAll(); return $parents;