From 8ee7fc8a9c691a5d384f79a5cc60246569185680 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Thu, 30 Jan 2014 13:23:31 -0500 Subject: [PATCH] bug #4265 Missing datepicker icon for DATETIME(length) Signed-off-by: Marc Delisle --- ChangeLog | 1 + libraries/insert_edit.lib.php | 7 ++++--- test/libraries/PMA_insert_edit_test.php | 5 ++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 305070090b37..8b320aabafef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ phpMyAdmin - ChangeLog - bug #4250 Notice on export page - bug #4253 "New" text in navigation frame acts like a database - bug #4262 Cannot define a column with fractional seconds +- bug #4265 Missing datepicker icon for DATETIME(length) 4.1.6.0 (2014-01-26) - bug #4232 User not found after creating the user diff --git a/libraries/insert_edit.lib.php b/libraries/insert_edit.lib.php index 1d3e394260b0..01b6681db282 100644 --- a/libraries/insert_edit.lib.php +++ b/libraries/insert_edit.lib.php @@ -1184,10 +1184,11 @@ function PMA_getHTMLinput($column, $column_name_appendix, $special_chars, // do not use the 'date' or 'time' types here; they have no effect on some // browsers and create side effects (see bug #4218) $the_class = 'textfield'; - if ($column['pma_type'] === 'date') { + // verify True_Type which does not contain the parentheses and length + if ($column['True_Type'] === 'date') { $the_class .= ' datefield'; - } elseif ($column['pma_type'] === 'datetime' - || substr($column['pma_type'], 0, 9) === 'timestamp' + } elseif ($column['True_Type'] === 'datetime' + || $column['True_Type'] === 'timestamp' ) { $the_class .= ' datetimefield'; } diff --git a/test/libraries/PMA_insert_edit_test.php b/test/libraries/PMA_insert_edit_test.php index 2a27bfb9aef1..287a6a99340b 100644 --- a/test/libraries/PMA_insert_edit_test.php +++ b/test/libraries/PMA_insert_edit_test.php @@ -1344,7 +1344,7 @@ public function testGetValueColumnForOtherDatatypes() $column['is_char'] = false; $column['Extra'] = 'auto_increment'; $column['pma_type'] = 'timestamp'; - $column['True_Type'] = 'bit'; + $column['True_Type'] = 'timestamp'; $result = PMA_getValueColumnForOtherDatatypes( $column, 'defchar', 'a', 'b', 'c', 22, '<', 12, 1, "/", "<", "foo\nbar", $extracted_columnspec @@ -1355,8 +1355,7 @@ public function testGetValueColumnForOtherDatatypes() . '', + . '="fields_typeb" value="timestamp" />', $result );