Commit 53864f13edf9bf21e2d89d4c5c2a2117a9aab21b

Authored by kevin_fourie
1 parent 7cf5f045

Fixed KTS-1499

"Fatal error caused by attempting to structure tree type metadata"

Removed ordering from WHERE sql as it seems the called getList function does that.



git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@6103 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/documentmanagement/MDTree.inc
@@ -115,8 +115,15 @@ class MDTree { @@ -115,8 +115,15 @@ class MDTree {
115 // right. we are now ready to start with the treebuild. 115 // right. we are now ready to start with the treebuild.
116 // root is a virtual node (id: 0). 116 // root is a virtual node (id: 0).
117 $this->field_id = $iFieldId; 117 $this->field_id = $iFieldId;
118 - $orderedTreeNodes =& MDTreeNode::getList('WHERE document_field_id = '.$iFieldId.' ORDER BY metadata_lookup_tree_parent, name ASC');  
119 - 118 + $orderedTreeNodes =& MDTreeNode::getList('WHERE document_field_id = '.$iFieldId);
  119 + if (PEAR::isError($orderedTreeNodes) || ($orderedTreeNodes === false)) {
  120 + #echo $orderedTreeNodes->message . "<br><br>";
  121 + #echo $orderedTreeNodes->userinfo . "<br><br>";
  122 + #echo print_r($orderedTreeNodes, true);
  123 + #exit;
  124 + $this->clear(); // make sure we don't get pollution.
  125 + return ; // and leave all null. WHY DOESN'T PHP HAVE EXCEPTIONS?
  126 + }
120 // since we have these nodes ordered by parent, we can perform a build 127 // since we have these nodes ordered by parent, we can perform a build
121 // we can build: 128 // we can build:
122 // $this->mapnodes [node_id => node] 129 // $this->mapnodes [node_id => node]