The branch, master has been updated via ea8b7f0176564d79858893c7d4d015c46c47634d (commit) via 2ebf0702f1ff2829f4b07430f27b83d473788244 (commit) via 64ae406cfdb55e100874c26136fd4ac14fbff029 (commit) from dd18e6c8aa20f17b24d35e7a3d0705009c4a29f6 (commit)
- Log ----------------------------------------------------------------- commit ea8b7f0176564d79858893c7d4d015c46c47634d Merge: 2ebf070 dd18e6c Author: Rouslan Placella rouslan@placella.com Date: Tue Aug 9 22:41:26 2011 +0100
Merge remote-tracking branch 'origin/master'
commit 2ebf0702f1ff2829f4b07430f27b83d473788244 Author: Rouslan Placella rouslan@placella.com Date: Tue Aug 9 22:40:57 2011 +0100
Fixed trigger editor unit test
commit 64ae406cfdb55e100874c26136fd4ac14fbff029 Author: Rouslan Placella rouslan@placella.com Date: Tue Aug 9 22:40:40 2011 +0100
Do not fetch views instead of filtering them out, when generating the trigger editor
-----------------------------------------------------------------------
Summary of changes: libraries/rte/rte_triggers.lib.php | 18 ++++++++++-------- test/libraries/rte/PMA_TRI_getEditorForm_test.php | 4 ++-- 2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/libraries/rte/rte_triggers.lib.php b/libraries/rte/rte_triggers.lib.php index 64b8b85..b4e5d40 100644 --- a/libraries/rte/rte_triggers.lib.php +++ b/libraries/rte/rte_triggers.lib.php @@ -286,6 +286,10 @@ function PMA_TRI_getEditorForm($mode, $item) $original_data = "<input name='item_original_name' " . "type='hidden' value='{$item['item_original_name']}'/>\n"; } + $query = "SELECT `TABLE_NAME` FROM `INFORMATION_SCHEMA`.`TABLES` "; + $query .= "WHERE `TABLE_SCHEMA`='" . PMA_sqlAddSlashes($db) . "' "; + $query .= "AND `TABLE_TYPE`='BASE TABLE'"; + $tables = PMA_DBI_fetch_result($query);
// Create the output $retval = ""; @@ -306,16 +310,14 @@ function PMA_TRI_getEditorForm($mode, $item) $retval .= " <td>" . __('Table') . "</td>\n"; $retval .= " <td>\n"; $retval .= " <select name='item_table'>\n"; - foreach (PMA_DBI_get_tables($db) as $key => $value) { + foreach ($tables as $key => $value) { $selected = ""; - if (! PMA_Table::isView($db, $value)) { - if ($mode == 'add' && $value == $table) { - $selected = " selected='selected'"; - } else if ($mode == 'edit' && $value == $item['item_table']) { - $selected = " selected='selected'"; - } - $retval .= " <option$selected>$value</option>\n"; + if ($mode == 'add' && $value == $table) { + $selected = " selected='selected'"; + } else if ($mode == 'edit' && $value == $item['item_table']) { + $selected = " selected='selected'"; } + $retval .= " <option$selected>$value</option>\n"; } $retval .= " </select>\n"; $retval .= " </td>\n"; diff --git a/test/libraries/rte/PMA_TRI_getEditorForm_test.php b/test/libraries/rte/PMA_TRI_getEditorForm_test.php index 53dc510..411a535 100644 --- a/test/libraries/rte/PMA_TRI_getEditorForm_test.php +++ b/test/libraries/rte/PMA_TRI_getEditorForm_test.php @@ -17,8 +17,8 @@ class PMA_TRI_getEditorForm_test extends PHPUnit_Framework_TestCase { public function setUp() { - if (! function_exists('PMA_DBI_get_tables')) { - function PMA_DBI_get_tables($db) + if (! function_exists('PMA_DBI_fetch_result')) { + function PMA_DBI_fetch_result($query) { return array('table1', 'table`2'); }
hooks/post-receive