From 791244d70bb00cd9e053e16468ab09b8484b6625 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Sat, 14 Sep 2013 16:35:06 +0530 Subject: [PATCH] bug #4092 Clicking on table name in view of information_schema redirects to wrong page --- ChangeLog | 1 + libraries/DisplayResults.class.php | 8 +- libraries/special_schema_links.lib.php | 176 ++++++++++++++++++------- 3 files changed, 131 insertions(+), 54 deletions(-) diff --git a/ChangeLog b/ChangeLog index a9226fe6a2..91d300202b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ phpMyAdmin - ChangeLog - bug #4089 Moving Columns will alter column definition - bug #4091 Insert ignore option does not work - bug #4090 Downloading BLOB downloads page template +- bug #4092 Clicking on table name in view of information_schema redirects to wrong page 4.0.6.0 (2013-09-05) - bug #4036 Call to undefined function mb_detect_encoding (clarify the doc) diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index dd79d6ee99..72fd17616b 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -3158,10 +3158,10 @@ class PMA_DisplayResults // Special case 1 - when executing routines, according // to the type of the routine, url param changes if (!empty($row_info['routine_type'])) { - if (strtolower($row_info['routine_type']) == self::ROUTINE_PROCEDURE) { - $linking_url_params['execute_routine'] = 1; - } else if (strtolower($row_info['routine_type']) == self::ROUTINE_FUNCTION) { - $linking_url_params['execute_dialog'] = 1; + if (strtolower($row_info['routine_type']) == self::ROUTINE_PROCEDURE + || strtolower($row_info['routine_type']) == self::ROUTINE_FUNCTION + ) { + $linking_url_params['edit_item'] = 1; } } } diff --git a/libraries/special_schema_links.lib.php b/libraries/special_schema_links.lib.php index d012f4b225..67e36afd95 100644 --- a/libraries/special_schema_links.lib.php +++ b/libraries/special_schema_links.lib.php @@ -14,7 +14,7 @@ if (! defined('PHPMYADMIN')) { * Major element represent a schema. * All the strings in this array represented in lower case * This global variable has not modified anywhere - * + * * Variable structure ex: * $GLOBALS['special_schema_links'] = array( * // Database name is the major element @@ -32,7 +32,7 @@ if (! defined('PHPMYADMIN')) { * // (can be array where url param has static value) * 'param_info' => 'hostname', * // Column name related to url param - * 'column_name' => 'host' + * 'column_name' => 'host' * ) * ), * // Page to link @@ -41,21 +41,21 @@ if (! defined('PHPMYADMIN')) { * ) * ) * ); - * + * */ $GLOBALS['special_schema_links'] = array( 'mysql' => array( 'db' => array( 'db' => array( 'link_param' => 'db', - 'default_page' => 'index.php' + 'default_page' => $GLOBALS['cfg']['DefaultTabDatabase'] ), 'user' => array( 'link_param' => 'username', 'link_dependancy_params' => array( 0 => array( 'param_info' => 'hostname', - 'column_name' => 'host' + 'column_name' => 'host' ) ), 'default_page' => 'server_privileges.php' @@ -64,9 +64,8 @@ $GLOBALS['special_schema_links'] = array( 'proc' => array( 'db' => array( 'link_param' => 'db', - 'default_page' => 'index.php' + 'default_page' => $GLOBALS['cfg']['DefaultTabDatabase'] ) - ), 'user' => array( 'user' => array( @@ -74,16 +73,19 @@ $GLOBALS['special_schema_links'] = array( 'link_dependancy_params' => array( 0 => array( 'param_info' => 'hostname', - 'column_name' => 'host' + 'column_name' => 'host' ) ), 'default_page' => 'server_privileges.php' ) - ) ), 'information_schema' => array( 'columns' => array( + 'table_schema' => array( + 'link_param' => 'db', + 'default_page' => $GLOBALS['cfg']['DefaultTabDatabase'] + ), 'table_name' => array( 'link_param' => 'table', 'link_dependancy_params' => array( @@ -92,7 +94,7 @@ $GLOBALS['special_schema_links'] = array( 'column_name' => 'table_schema' ) ), - 'default_page' => 'index.php' + 'default_page' => $GLOBALS['cfg']['DefaultTabTable'] ), 'column_name' => array( 'link_param' => array( @@ -103,14 +105,32 @@ $GLOBALS['special_schema_links'] = array( 'link_dependancy_params' => array( 0 => array( 'param_info' => 'db', - 'column_name' => 'table_schema' + 'column_name' => 'table_schema' ), 1 => array( 'param_info' => 'table', - 'column_name' => 'table_name' + 'column_name' => 'table_name' ) ), - 'default_page' => 'index.php' + 'default_page' => 'sql.php' + ) + ), + 'column_privileges' => array( + 'table_schema' => array( + 'link_param' => 'db', + 'default_page' => $GLOBALS['cfg']['DefaultTabDatabase'] + ) + ), + 'events' => array( + 'event_schema' => array( + 'link_param' => 'db', + 'default_page' => $GLOBALS['cfg']['DefaultTabDatabase'] + ) + ), + 'files' => array( + 'table_schema' => array( + 'link_param' => 'db', + 'default_page' => $GLOBALS['cfg']['DefaultTabDatabase'] ) ), 'key_column_usage' => array( @@ -119,10 +139,10 @@ $GLOBALS['special_schema_links'] = array( 'link_dependancy_params' => array( 0 => array( 'param_info' => 'db', - 'column_name' => 'constraint_schema' + 'column_name' => 'constraint_schema' ) ), - 'default_page' => 'index.php' + 'default_page' => $GLOBALS['cfg']['DefaultTabTable'] ), 'column_name' => array( 'link_param' => array( @@ -133,28 +153,36 @@ $GLOBALS['special_schema_links'] = array( 'link_dependancy_params' => array( 0 => array( 'param_info' => 'db', - 'column_name' => 'table_schema' + 'column_name' => 'table_schema' ), 1 => array( 'param_info' => 'table', - 'column_name' => 'table_name' + 'column_name' => 'table_name' ) ), - 'default_page' => 'index.php' + 'default_page' => 'sql.php' + ), + 'constraint_schema' => array( + 'link_param' => 'db', + 'default_page' => $GLOBALS['cfg']['DefaultTabDatabase'] + ), + 'table_schema' => array( + 'link_param' => 'db', + 'default_page' => $GLOBALS['cfg']['DefaultTabDatabase'] ), 'referenced_table_schema' => array( 'link_param' => 'db', - 'default_page' => 'index.php' + 'default_page' => $GLOBALS['cfg']['DefaultTabDatabase'] ), 'referenced_table_name' => array( 'link_param' => 'table', 'link_dependancy_params' => array( 0 => array( 'param_info' => 'db', - 'column_name' => 'referenced_table_schema' + 'column_name' => 'referenced_table_schema' ) ), - 'default_page' => 'index.php' + 'default_page' => $GLOBALS['cfg']['DefaultTabTable'] ), 'referenced_column_name' => array( 'link_param' => array( @@ -165,43 +193,49 @@ $GLOBALS['special_schema_links'] = array( 'link_dependancy_params' => array( 0 => array( 'param_info' => 'db', - 'column_name' => 'referenced_table_schema' + 'column_name' => 'referenced_table_schema' ), 1 => array( 'param_info' => 'table', - 'column_name' => 'referenced_table_name' + 'column_name' => 'referenced_table_name' ) ), - 'default_page' => 'index.php' + 'default_page' => 'sql.php' + ) + ), + 'parameters' => array( + 'specific_schema' => array( + 'link_param' => 'db', + 'default_page' => $GLOBALS['cfg']['DefaultTabDatabase'] ) ), 'partitions' => array( 'table_schema' => array( 'link_param' => 'db', - 'default_page' => 'index.php' + 'default_page' => $GLOBALS['cfg']['DefaultTabDatabase'] ), 'table_name' => array( 'link_param' => 'table', 'link_dependancy_params' => array( 0 => array( 'param_info' => 'db', - 'column_name' => 'table_schema' + 'column_name' => 'table_schema' ) ), - 'default_page' => 'index.php' + 'default_page' => $GLOBALS['cfg']['DefaultTabTable'] ) ), 'processlist' => array( 'db' => array( 'link_param' => 'db', - 'default_page' => 'index.php' + 'default_page' => $GLOBALS['cfg']['DefaultTabDatabase'] ), 'user' => array( 'link_param' => 'username', 'link_dependancy_params' => array( 0 => array( 'param_info' => 'hostname', - 'column_name' => 'host' + 'column_name' => 'host' ) ), 'default_page' => 'server_privileges.php' @@ -210,32 +244,32 @@ $GLOBALS['special_schema_links'] = array( 'referential_constraints' => array( 'constraint_schema' => array( 'link_param' => 'db', - 'default_page' => 'index.php' + 'default_page' => $GLOBALS['cfg']['DefaultTabDatabase'] ), 'unique_constraint_schema' => array( 'link_param' => 'db', - 'default_page' => 'index.php' + 'default_page' => $GLOBALS['cfg']['DefaultTabDatabase'] ), 'table_name' => array( 'link_param' => 'table', 'link_dependancy_params' => array( 0 => array( 'param_info' => 'db', - 'column_name' => 'constraint_schema' + 'column_name' => 'constraint_schema' ) ), - 'default_page' => 'index.php' + 'default_page' => $GLOBALS['cfg']['DefaultTabTable'] ), 'referenced_table_name' => array( 'link_param' => 'table', 'link_dependancy_params' => array( 0 => array( 'param_info' => 'db', - 'column_name' => 'constraint_schema' + 'column_name' => 'constraint_schema' ) ), - 'default_page' => 'index.php' - ) + 'default_page' => $GLOBALS['cfg']['DefaultTabTable'] + ) ), 'routines' => array( 'routine_name' => array( @@ -243,7 +277,7 @@ $GLOBALS['special_schema_links'] = array( 'link_dependancy_params' => array( 0 => array( 'param_info' => 'db', - 'column_name' => 'routine_schema' + 'column_name' => 'routine_schema' ), 1 => array( 'param_info' => 'item_type', @@ -251,28 +285,42 @@ $GLOBALS['special_schema_links'] = array( ) ), 'default_page' => 'db_routines.php' - ) + ), + 'routine_schema' => array( + 'link_param' => 'db', + 'default_page' => $GLOBALS['cfg']['DefaultTabDatabase'] + ), ), 'schemata' => array( 'schema_name' => array( 'link_param' => 'db', - 'default_page' => 'index.php' + 'default_page' => $GLOBALS['cfg']['DefaultTabDatabase'] + ) + ), + 'schema_privileges' => array( + 'table_schema' => array( + 'link_param' => 'db', + 'default_page' => $GLOBALS['cfg']['DefaultTabDatabase'] ) ), 'statistics' => array( 'table_schema' => array( 'link_param' => 'db', - 'default_page' => 'index.php' + 'default_page' => $GLOBALS['cfg']['DefaultTabDatabase'] + ), + 'index_schema' => array( + 'link_param' => 'db', + 'default_page' => $GLOBALS['cfg']['DefaultTabDatabase'] ), 'table_name' => array( 'link_param' => 'table', 'link_dependancy_params' => array( 0 => array( 'param_info' => 'db', - 'column_name' => 'table_schema' + 'column_name' => 'table_schema' ) ), - 'default_page' => 'index.php' + 'default_page' => $GLOBALS['cfg']['DefaultTabTable'] ), 'column_name' => array( 'link_param' => array( @@ -283,14 +331,14 @@ $GLOBALS['special_schema_links'] = array( 'link_dependancy_params' => array( 0 => array( 'param_info' => 'db', - 'column_name' => 'table_schema' + 'column_name' => 'table_schema' ), 1 => array( 'param_info' => 'table', - 'column_name' => 'table_name' + 'column_name' => 'table_name' ) ), - 'default_page' => 'index.php' + 'default_page' => 'sql.php' ) ), 'tables' => array( @@ -299,10 +347,14 @@ $GLOBALS['special_schema_links'] = array( 'link_dependancy_params' => array( 0 => array( 'param_info' => 'db', - 'column_name' => 'table_schema' + 'column_name' => 'table_schema' ) ), - 'default_page' => 'index.php' + 'default_page' => $GLOBALS['cfg']['DefaultTabTable'] + ), + 'table_schema' => array( + 'link_param' => 'db', + 'default_page' => $GLOBALS['cfg']['DefaultTabDatabase'] ) ), 'table_constraints' => array( @@ -311,12 +363,36 @@ $GLOBALS['special_schema_links'] = array( 'link_dependancy_params' => array( 0 => array( 'param_info' => 'db', - 'column_name' => 'table_schema' + 'column_name' => 'table_schema' ) ), - 'default_page' => 'index.php' + 'default_page' => $GLOBALS['cfg']['DefaultTabTable'] + ), + 'constraint_schema' => array( + 'link_param' => 'db', + 'default_page' => $GLOBALS['cfg']['DefaultTabDatabase'] + ), + 'table_schema' => array( + 'link_param' => 'db', + 'default_page' => $GLOBALS['cfg']['DefaultTabDatabase'] ) - ) + ), + 'table_privileges' => array( + 'table_schema' => array( + 'link_param' => 'db', + 'default_page' => $GLOBALS['cfg']['DefaultTabDatabase'] + ) + ), + 'triggers' => array( + 'trigger_schema' => array( + 'link_param' => 'db', + 'default_page' => $GLOBALS['cfg']['DefaultTabDatabase'] + ), + 'event_object_schema' => array( + 'link_param' => 'db', + 'default_page' => $GLOBALS['cfg']['DefaultTabDatabase'] + ) + ), ) );