Year Field Save Error

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Year Field Save Error

Jerry-2

Hi Bakers:

When I try to bake my app (scaffold is on) with a field type "year"
(also name as "year"),
I found the data cannot be saved (the selection did show up and I
select the year).

The results always appear as '0000'.
When I check the html source generated by cakephp, the field name is
Model/year_year,
not just Model/year, is that the root cause of saving error?

Jerry
http://www.fonsen.com.tw/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Year Field Save Error

Eric C Blount
It's possible that year is a reserved word. Have you tried simply renaming that database field, maybe to event_year? Give it a shot!
 
HTH,
Eric

 
On 11/1/06, Jerry <[hidden email]> wrote:

Hi Bakers:

When I try to bake my app (scaffold is on) with a field type "year"
(also name as "year"),
I found the data cannot be saved (the selection did show up and I
select the year).

The results always appear as '0000'.
When I check the html source generated by cakephp, the field name is
Model/year_year,
not just Model/year, is that the root cause of saving error?

Jerry
http://www.fonsen.com.tw/




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Year Field Save Error

Jerry-2

Hi Eric:

Thanks for your reply. I tried to set the column name to year_num, but
still not working.
Field type is still year.

Jerry
--
http://www.fonsen.com.tw/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Year Field Save Error

Jerry-2

One more strange thing:

If I use bake.php to generate the code, the field with field type
'year' will not be generated by bake.php script.
The name of the field is 'yr'.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Year Field Save Error

Jerry-2
In reply to this post by Jerry-2

Hello bakers:

Finally I found solution on trac.cakephp.org.  Thanks to trac!
The solution I found is on
https://trac.cakephp.org/changeset/3490

In my situation (using 1.1.8.3544 cakephp), the only file I need to
modify is
cake/libs/controller/controller.php

and just added the code as posted in trac.

Thanks trac, thanks cake.

Jerry
--
http://www.fonsen.com.tw/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---