From 1a62c147fee83c85ce69b90b0f4a550944a034de Mon Sep 17 00:00:00 2001 From: Val Bancer Date: Wed, 12 Sep 2018 16:45:01 +0200 Subject: [PATCH 1/3] Improve handling of CURRENT_TIMESTAMP default value Resolves https://github.com/cakephp/cakephp/issues/12553. --- lib/Cake/Model/Datasource/DboSource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Model/Datasource/DboSource.php b/lib/Cake/Model/Datasource/DboSource.php index 8930ed3dd..1af4f9eee 100644 --- a/lib/Cake/Model/Datasource/DboSource.php +++ b/lib/Cake/Model/Datasource/DboSource.php @@ -3539,7 +3539,7 @@ class DboSource extends DataSource { } elseif (isset($column['null']) && $column['null'] === false) { $out .= ' NOT NULL'; } - if ($type === 'timestamp' && isset($column['default']) && strtolower($column['default']) === 'current_timestamp') { + if (in_array($type, array('timestamp', 'datetime')) && isset($column['default']) && strtolower($column['default']) === 'current_timestamp') { $out = str_replace(array("'CURRENT_TIMESTAMP'", "'current_timestamp'"), 'CURRENT_TIMESTAMP', $out); } return $this->_buildFieldParameters($out, $column, 'afterDefault'); From a7a49c5f8e6aafe5acf424a78752ebc7f1557b37 Mon Sep 17 00:00:00 2001 From: Val Bancer Date: Wed, 12 Sep 2018 17:32:00 +0200 Subject: [PATCH 2/3] Fix syntax --- lib/Cake/Test/Case/Model/ModelReadTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/Cake/Test/Case/Model/ModelReadTest.php b/lib/Cake/Test/Case/Model/ModelReadTest.php index feda62de2..05f27cb8a 100644 --- a/lib/Cake/Test/Case/Model/ModelReadTest.php +++ b/lib/Cake/Test/Case/Model/ModelReadTest.php @@ -6559,7 +6559,6 @@ class ModelReadTest extends BaseModelTest { public function testBuildQueryCountI18nConditions() { $this->skipIf(!$this->db instanceof Mysql, 'This test is only compatible with Mysql.'); $dbName = $this->db->config['database']; - j $this->loadFixtures('TranslateArticle', 'TranslatedArticle', 'User'); $TestModel = new TranslatedArticle(); $TestModel->cacheQueries = false; From d7b5cda0ea5df9bb146ec69915d04bd403f1a7f2 Mon Sep 17 00:00:00 2001 From: Val Bancer Date: Wed, 12 Sep 2018 18:14:24 +0200 Subject: [PATCH 3/3] Fix PHP 5.3 syntax --- lib/Cake/View/Helper/FormHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/View/Helper/FormHelper.php b/lib/Cake/View/Helper/FormHelper.php index 141bde656..83eb67eaf 100644 --- a/lib/Cake/View/Helper/FormHelper.php +++ b/lib/Cake/View/Helper/FormHelper.php @@ -1061,7 +1061,7 @@ class FormHelper extends AppHelper { $radioOptions = (array)$options['options']; unset($options['options']); } else { - $radioOptions = []; + $radioOptions = array(); } $label = $this->_getLabel($fieldName, $options);