1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 21:57:51 +02:00

admin UI: filter response - bad query auto-generated in some cases

This commit is contained in:
secretr
2010-03-01 12:59:26 +00:00
parent 96f99a2d5f
commit 72e86d2f06

View File

@@ -2523,7 +2523,6 @@ class e_admin_controller_ui extends e_admin_controller
*/ */
protected function convertToData(&$data) protected function convertToData(&$data)
{ {
$model = new e_model($data); $model = new e_model($data);
foreach ($this->getFields() as $key => $attributes) foreach ($this->getFields() as $key => $attributes)
{ {
@@ -2616,7 +2615,7 @@ class e_admin_controller_ui extends e_admin_controller
*/ */
protected function renderAjaxFilterResponse($listQry = '') protected function renderAjaxFilterResponse($listQry = '')
{ {
$debug = false;
$srch = $this->getPosted('searchquery'); $srch = $this->getPosted('searchquery');
$this->getRequest()->setQuery('searchquery', $srch); //_modifyListQry() is requiring GET String $this->getRequest()->setQuery('searchquery', $srch); //_modifyListQry() is requiring GET String
@@ -2631,7 +2630,7 @@ class e_admin_controller_ui extends e_admin_controller
// Make query // Make query
$sql = e107::getDb(); $sql = e107::getDb();
if($qry && $sql->db_Select_gen($qry)) if($qry && $sql->db_Select_gen($qry, $debug))
{ {
while ($res = $sql->db_Fetch()) while ($res = $sql->db_Fetch())
{ {
@@ -2807,6 +2806,7 @@ class e_admin_controller_ui extends e_admin_controller
$tableSFields = $tableSFieldsArr ? implode(', ', $tableSFieldsArr) : $tablePath.'*'; $tableSFields = $tableSFieldsArr ? implode(', ', $tableSFieldsArr) : $tablePath.'*';
} }
$jwhere = array(); $jwhere = array();
$joins = array(); $joins = array();
//file_put_contents('e:/www/log', $tableSFields."\n\n", FILE_APPEND); //file_put_contents('e:/www/log', $tableSFields."\n\n", FILE_APPEND);
@@ -2846,7 +2846,7 @@ class e_admin_controller_ui extends e_admin_controller
} }
//From //From
$qry .= ', '.implode(', ', $tableSJoinArr)." FROM ".$tableFrom; $qry .= $tableSJoinArr ? ', '.implode(', ', $tableSJoinArr)." FROM ".$tableFrom : " FROM ".$tableFrom;
// Joins // Joins
if(count($joins) > 0) if(count($joins) > 0)