From 16335c74d0a7748ed09980ffab842f6da23d6a6c Mon Sep 17 00:00:00 2001 From: CaMer0n Date: Mon, 9 Nov 2009 03:03:41 +0000 Subject: [PATCH] Quick query fix and some debug info added. --- e107_handlers/admin_handler.php | 13 +++++++++++-- e107_handlers/mysql_class.php | 9 ++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/e107_handlers/admin_handler.php b/e107_handlers/admin_handler.php index dd858ab74..b5d4ea961 100644 --- a/e107_handlers/admin_handler.php +++ b/e107_handlers/admin_handler.php @@ -2285,10 +2285,12 @@ class e_admin_ui extends e_admin_controller_ui $ftable = vartrue($var['table'], $this->getTableName()); if(($var['type'] == 'text' || $var['type'] == 'method') && $searchQuery) { - $filter[] = "(`{$ftable}`.`".$key."` REGEXP ('".$searchQuery."'))"; + $filter[] = "(`#{$ftable}`.`".$key."` REGEXP ('".$searchQuery."'))"; } } + + //$qry = $this->listQry; // We dont need list qry anymore! $jwhere = array(); @@ -2378,6 +2380,12 @@ class e_admin_ui extends e_admin_controller_ui public function getPrimaryName() { + if(!varset($this->pid)) + { + $mes = e107::getMessage(); + $mes->add("There is no pid set.", E_MESSAGE_WARNING); + } + return $this->pid; } @@ -2738,6 +2746,7 @@ class e_admin_form_ui extends e_form { $tp = e107::getParser(); $controller = $this->getController(); + $request = $controller->getRequest(); $tree = $controller->getTreeModel(); $options = array( @@ -2920,7 +2929,7 @@ class e_admin_form_ui extends e_form * @return e_admin_ui */ public function getController() - { + { return $this->_controller; } } diff --git a/e107_handlers/mysql_class.php b/e107_handlers/mysql_class.php index d0550869c..f15246c71 100644 --- a/e107_handlers/mysql_class.php +++ b/e107_handlers/mysql_class.php @@ -9,8 +9,8 @@ * mySQL Handler * * $Source: /cvs_backup/e107_0.8/e107_handlers/mysql_class.php,v $ - * $Revision: 1.61 $ - * $Date: 2009-11-08 12:08:24 $ + * $Revision: 1.62 $ + * $Date: 2009-11-09 03:03:41 $ * $Author: e107coders $ */ @@ -49,7 +49,7 @@ $db_ConnectionID = NULL; // Stores ID for the first DB connection used - which s * * @package e107 * @category e107_handlers - * @version $Revision: 1.61 $ + * @version $Revision: 1.62 $ * @author $Author: e107coders $ * */ @@ -852,6 +852,9 @@ class e_db_mysql { { $query = preg_replace_callback("/\s#([\w]*?)\W/", array($this, 'ml_check'), $query); } + + //FIXME - this is a quick Fix for REGEXP queries, as used in admin_ui. + $query = str_replace("`#","`".$this->mySQLPrefix,$query); if (($this->mySQLresult = $this->db_Query($query, NULL, 'db_Select_gen', $debug, $log_type, $log_remark)) === TRUE) { // Successful query which doesn't return a row count