diff options
author | dmitry-radyno <dmitry.radyno@gmail.com> | 2013-06-03 16:28:27 +0200 |
---|---|---|
committer | dmitry-radyno <dmitry.radyno@gmail.com> | 2013-06-03 16:28:27 +0200 |
commit | 5a5a7f32d8187ed93bd1f845bc262eb590a2bb4d (patch) | |
tree | a04cf5dc70786eeeb9ed908e489a1fddba24b9c0 | |
parent | e110a3ec49169db9eda2a78e2842b5da1dac2fc9 (diff) | |
download | connector-php-5a5a7f32d8187ed93bd1f845bc262eb590a2bb4d.zip connector-php-5a5a7f32d8187ed93bd1f845bc262eb590a2bb4d.tar.gz connector-php-5a5a7f32d8187ed93bd1f845bc262eb590a2bb4d.tar.bz2 |
fix mix in json tree connector
-rw-r--r-- | codebase/strategy.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/codebase/strategy.php b/codebase/strategy.php index eb579b8..ac3550c 100644 --- a/codebase/strategy.php +++ b/codebase/strategy.php @@ -153,6 +153,7 @@ class TreeRenderStrategy extends RenderStrategy { $output=""; $index=0; $conn = $this->conn; + $config_copy = new DataConfig($config); $this->mix($config, $mix); while ($data=$conn->sql->get_next($res)){ $data = $this->simple_mix($mix, $data); @@ -166,8 +167,9 @@ class TreeRenderStrategy extends RenderStrategy { $output.=$data->to_xml_start(); if ($data->has_kids()===-1 || ( $data->has_kids()==true && !$dload)){ $sub_request = new DataRequestConfig($conn->get_request()); + $sub_request->set_fieldset(implode(",",$config_copy->db_names_list($conn->sql))); $sub_request->set_relation($data->get_id()); - $output.=$this->render_set($conn->sql->select($sub_request), $name, $dload, $sep, $config); + $output.=$this->render_set($conn->sql->select($sub_request), $name, $dload, $sep, $config_copy, $mix); } $output.=$data->to_xml_end(); $index++; @@ -205,6 +207,7 @@ class JSONTreeRenderStrategy extends TreeRenderStrategy { $output=array(); $index=0; $conn = $this->conn; + $config_copy = new DataConfig($config); $this->mix($config, $mix); while ($data=$conn->sql->get_next($res)){ $data = $this->complex_mix($mix, $data); @@ -218,8 +221,9 @@ class JSONTreeRenderStrategy extends TreeRenderStrategy { $record = $data->to_xml_start(); if ($data->has_kids()===-1 || ( $data->has_kids()==true && !$dload)){ $sub_request = new DataRequestConfig($conn->get_request()); + $sub_request->set_fieldset(implode(",",$config_copy->db_names_list($conn->sql))); $sub_request->set_relation($data->get_id()); - $temp = $this->render_set($conn->sql->select($sub_request), $name, $dload, $sep, $config, $mix); + $temp = $this->render_set($conn->sql->select($sub_request), $name, $dload, $sep, $config_copy, $mix); if (sizeof($temp)) $record["data"] = $temp; } |