mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge pull request #12554 from bancer/patch-1
Improve handling of CURRENT_TIMESTAMP default value
This commit is contained in:
commit
2273428dca
3 changed files with 2 additions and 3 deletions
|
@ -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');
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1061,7 +1061,7 @@ class FormHelper extends AppHelper {
|
|||
$radioOptions = (array)$options['options'];
|
||||
unset($options['options']);
|
||||
} else {
|
||||
$radioOptions = [];
|
||||
$radioOptions = array();
|
||||
}
|
||||
|
||||
$label = $this->_getLabel($fieldName, $options);
|
||||
|
|
Loading…
Reference in a new issue