diff --git a/ChangeLog b/ChangeLog
index 39a3e64aac..c249cd17e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -54,6 +54,8 @@ VerboseMultiSubmit, ReplaceHelpImg
- bug #3531584 [interface] No form validation in change password dialog
- bug #3531585 [interface] Broken password validation in copy user form
- bug #3531586 [unterface] Add user form prints JSON when user presses enter
+- bug #3534121 [config] duplicate line in config.sample.inc.php
+- bug #3534311 [interface] Grid editing incorrectly parses ENUM/SET values
3.5.1.0 (2012-05-03)
- bug #3510784 [edit] Limit clause ignored when sort order is remembered
diff --git a/config.sample.inc.php b/config.sample.inc.php
index 69bc6242d5..7a16073bac 100644
--- a/config.sample.inc.php
+++ b/config.sample.inc.php
@@ -58,7 +58,6 @@ $cfg['Servers'][$i]['AllowNoPassword'] = false;
// $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
// $cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';
// $cfg['Servers'][$i]['recent'] = 'pma_recent';
-// $cfg['Servers'][$i]['table_uiprefs'] = 'pma_table_uiprefs';
/* Contrib / Swekey authentication */
// $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';
diff --git a/js/server_status.js b/js/server_status.js
index 6677d7b0dc..edd0c54658 100644
--- a/js/server_status.js
+++ b/js/server_status.js
@@ -130,10 +130,6 @@ $(function() {
}
});
- $.ajaxSetup({
- cache: false
- });
-
// Add tabs
$('#serverStatusTabs').tabs({
// Tab persistence
diff --git a/js/tbl_zoom_plot_jqplot.js b/js/tbl_zoom_plot_jqplot.js
index 006e6cd15e..e7d60eeb8d 100644
--- a/js/tbl_zoom_plot_jqplot.js
+++ b/js/tbl_zoom_plot_jqplot.js
@@ -139,7 +139,7 @@ $(document).ready(function() {
'table' : window.parent.table,
'field' : $('#tableid_0').val(),
'it' : 0,
- 'token' : window.parent.token,
+ 'token' : window.parent.token
},function(data) {
$('#tableFieldsId tr:eq(1) td:eq(0)').html(data.field_type);
$('#tableFieldsId tr:eq(1) td:eq(1)').html(data.field_collation);
@@ -163,7 +163,7 @@ $(document).ready(function() {
'table' : window.parent.table,
'field' : $('#tableid_1').val(),
'it' : 1,
- 'token' : window.parent.token,
+ 'token' : window.parent.token
},function(data) {
$('#tableFieldsId tr:eq(3) td:eq(0)').html(data.field_type);
$('#tableFieldsId tr:eq(3) td:eq(1)').html(data.field_collation);
@@ -186,7 +186,7 @@ $(document).ready(function() {
'table' : window.parent.table,
'field' : $('#tableid_2').val(),
'it' : 2,
- 'token' : window.parent.token,
+ 'token' : window.parent.token
},function(data) {
$('#tableFieldsId tr:eq(6) td:eq(0)').html(data.field_type);
$('#tableFieldsId tr:eq(6) td:eq(1)').html(data.field_collation);
@@ -207,7 +207,7 @@ $(document).ready(function() {
'table' : window.parent.table,
'field' : $('#tableid_3').val(),
'it' : 3,
- 'token' : window.parent.token,
+ 'token' : window.parent.token
},function(data) {
$('#tableFieldsId tr:eq(8) td:eq(0)').html(data.field_type);
$('#tableFieldsId tr:eq(8) td:eq(1)').html(data.field_collation);
@@ -264,14 +264,14 @@ $(document).ready(function() {
//Find changed values by comparing form values with selectedRow Object
var newValues = new Object();//Stores the values changed from original
var sqlTypes = new Object();
- var it = 4;
+ var it = 0;
var xChange = false;
var yChange = false;
for (key in selectedRow) {
var oldVal = selectedRow[key];
- var newVal = ($('#fields_null_id_' + it).attr('checked')) ? null : $('#fieldID_' + it).val();
+ var newVal = ($('#edit_fields_null_id_' + it).attr('checked')) ? null : $('#edit_fieldID_' + it).val();
if (newVal instanceof Array) { // when the column is of type SET
- newVal = $('#fieldID_' + it).map(function(){
+ newVal = $('#edit_fieldID_' + it).map(function(){
return $(this).val();
}).get().join(",");
}
@@ -286,7 +286,7 @@ $(document).ready(function() {
searchedData[searchedDataKey][yLabel] = newVal;
}
}
- var $input = $('#fieldID_' + it);
+ var $input = $('#edit_fieldID_' + it);
if ($input.hasClass('bit')) {
sqlTypes[key] = 'bit';
}
@@ -534,6 +534,7 @@ $(document).ready(function() {
// resizing, it's ok
// under IE 9, everything is fine
currentChart = $.jqplot('querychart', series, options);
+ currentChart.resetZoom();
$('button.button-reset').click(function(event) {
event.preventDefault();
@@ -551,7 +552,7 @@ $(document).ready(function() {
$('div#querychart').bind('jqplotDataClick',
function(event, seriesIndex, pointIndex, data) {
searchedDataKey = data[4]; // key from searchedData (global)
- var field_id = 4;
+ var field_id = 0;
var post_params = {
'ajax_request' : true,
'get_data_row' : true,
@@ -565,8 +566,8 @@ $(document).ready(function() {
// Row is contained in data.row_info,
// now fill the displayResultForm with row values
for (key in data.row_info) {
- $field = $('#fieldID_' + field_id);
- $field_null = $('#fields_null_id_' + field_id);
+ $field = $('#edit_fieldID_' + field_id);
+ $field_null = $('#edit_fields_null_id_' + field_id);
if (data.row_info[key] == null) {
$field_null.attr('checked', true);
$field.val('');
diff --git a/libraries/common.lib.php b/libraries/common.lib.php
index 50b57a4085..1b1d9b82eb 100644
--- a/libraries/common.lib.php
+++ b/libraries/common.lib.php
@@ -3945,4 +3945,48 @@ function PMA_printButton()
. __('Print') . '" />';
echo '
';
}
+
+/**
+ * Parses ENUM/SET values
+ *
+ * @param string $definition The definition of the column
+ * for which to parse the values
+ *
+ * @return array
+ */
+function PMA_parseEnumSetValues($definition)
+{
+ $values_string = htmlentities($definition);
+ // There is a JS port of the below parser in functions.js
+ // If you are fixing something here,
+ // you need to also update the JS port.
+ $values = array();
+ $in_string = false;
+ $buffer = '';
+ for ($i=0; $i 0) {
+ // The leftovers in the buffer are the last value (if any)
+ $values[] = $buffer;
+ }
+ return $values;
+}
+
?>
diff --git a/libraries/tbl_select.lib.php b/libraries/tbl_select.lib.php
index 757b94970c..e481e074b8 100644
--- a/libraries/tbl_select.lib.php
+++ b/libraries/tbl_select.lib.php
@@ -22,18 +22,18 @@ if (! defined('PHPMYADMIN')) {
function PMA_tbl_getFields($db, $table)
{
// Gets the list and number of fields
- $fields = PMA_DBI_get_columns($db, $table, null, true);
- $fields_list = $fields_null = $fields_type = $fields_collation = array();
- $geom_column_present = false;
+ $columns = PMA_DBI_get_columns($db, $table, null, true);
+ $columnNames = $columnNullFlags = $columnTypes = $columnCollations = array();
+ $geomColumnFlag = false;
$geom_types = PMA_getGISDatatypes();
- foreach ($fields as $key => $row) {
- $fields_list[] = $row['Field'];
+ foreach ($columns as $key => $row) {
+ $columnNames[] = $row['Field'];
$type = $row['Type'];
// check whether table contains geometric columns
if (in_array($type, $geom_types)) {
- $geom_column_present = true;
+ $geomColumnFlag = true;
}
// reformat mysql query output
@@ -55,35 +55,35 @@ function PMA_tbl_getFields($db, $table)
if (empty($type)) {
$type = ' ';
}
- $fields_null[] = $row['Null'];
- $fields_type[] = $type;
- $fields_collation[]
+ $columnNullFlags[] = $row['Null'];
+ $columnTypes[] = $type;
+ $columnCollations[]
= ! empty($row['Collation']) && $row['Collation'] != 'NULL'
? $row['Collation']
: '';
} // end while
return array(
- $fields_list,
- $fields_type,
- $fields_collation,
- $fields_null,
- $geom_column_present
+ $columnNames,
+ $columnTypes,
+ $columnCollations,
+ $columnNullFlags,
+ $geomColumnFlag
);
}
/**
* Sets the table header for displaying a table in query-by-example format.
*
- * @param bool $geom_column_present whether a geometry column is present
+ * @param bool $geomColumnFlag whether a geometry column is present
*
* @return HTML content, the tags and content for table header
*/
-function PMA_tbl_setTableHeader($geom_column_present = false)
+function PMA_tbl_getTableHeader($geomColumnFlag = false)
{
- // Display the Function column only if there is alteast one geomety colum
+ // Display the Function column only if there is at least one geometry column
$func = '';
- if ($geom_column_present) {
+ if ($geomColumnFlag) {
$func = '' . __('Function') . ' | ';
}
@@ -129,13 +129,13 @@ function PMA_tbl_getSubTabs()
* @param array $foreigners Array of foreign keys
* @param array $foreignData Foreign keys data
* @param string $field Column name
- * @param string $tbl_fields_type Column type
- * @param int $i Column index
+ * @param string $field_type Column type
+ * @param int $column_index Column index
* @param string $db Selected database
* @param string $table Selected table
* @param array $titles Selected title
* @param int $foreignMaxLimit Max limit of displaying foreign elements
- * @param array $fields Array of search criteria inputs
+ * @param array $criteriaValues Array of search criteria inputs
* @param bool $in_fbs Whether we are in 'function based search'
* @param bool $in_zoom_search_edit Whether we are in zoom search edit
*
@@ -143,16 +143,19 @@ function PMA_tbl_getSubTabs()
* for search criteria input.
*/
function PMA_getForeignFields_Values($foreigners, $foreignData, $field,
- $tbl_fields_type, $i, $db, $table, $titles, $foreignMaxLimit, $fields,
- $in_fbs = false, $in_zoom_search_edit = false
+ $field_type, $column_index, $db, $table, $titles, $foreignMaxLimit,
+ $criteriaValues, $in_fbs = false, $in_zoom_search_edit = false
) {
$str = '';
+ $field_type = (string)$field_type;
+ $field_id = ($in_zoom_search_edit) ? 'edit_fieldID_' : 'fieldID_';
if ($foreigners
&& isset($foreigners[$field])
&& is_array($foreignData['disp_row'])
) {
// f o r e i g n k e y s
- $str .= '