-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"cake bake all" should include 'empty' => true, 'default' => '' for date DEFAULT NULL fields #35
Comments
With the change of cakephp/cakephp#6559 only |
Thank you Mark ! A couple of months ago I began to look at the problem of "single quotes" I looked at the Jenkins logs trying to determine the process. I am on a However I was able to come up with a crude solution which worked on my I have attached that piece of preprocessor code. If you think it has Best regards Lorne On 14/05/2015 6:58 AM, Mark S. wrote:
|
Are you sure you wanted to answer this issue? Your report looks totally off topic.. |
Sorry Mark ! I have been away from cakePHP work for a couple of months. On 14/05/2015 1:57 PM, Mark S. wrote:
|
I will try to take care of this today. //Edit: Postponed to tomorrow (30.10), sorry. |
Thanks @DSchalla |
Remove unnecessary attribute from date inputs (Closes #35)
For a database field defined "date DEFAULT NULL" a user must currently modify the generated add.ctp and edit.ctp code to include ' array('empty' => true, 'default' => '') ' for the application to store correctly a NULL.
The current generated code is echo $this->Form->input('date_of_birth'); and the result on Submit is to store the date displayed in the 'date_of_birth' panel.
A test case is produced by doing a "cake bake all users" on the following table.
CREATE TABLE IF NOT EXISTS users (
id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
username varchar(254) NOT NULL,
user_email varchar(254) NOT NULL,
date_of_birth date DEFAULT NULL,
UNIQUE KEY (username),
KEY (user_email),
PRIMARY KEY (id)
);
The text was updated successfully, but these errors were encountered: