On Thu, Aug 19, 2010 at 4:52 PM, Oriol Franquesa <[email protected]> wrote: > I think there's a problem trying to do a save() in a model that > contains one "Date" type column: > > Cake manages automatic conversions between human format date and > DataBase format. > > In particular, when I make a save operation, cake try to converts the > date with the following function declared in app/models/behaviors/ > date_formatter.ctp > > I get this warnings-errors: > > ***************************************** > Warning (2): array_combine() [function.array-combine]: Both parameters > should have an equal number of elements [APP\models\behaviors > \date_formatter.php, line 83] > > Warning (2): array_combine() [function.array-combine]: Both parameters > should have an equal number of elements [APP\models\behaviors > \date_formatter.php, line 84] > > Warning (2): Invalid argument supplied for foreach() [APP\models > \behaviors\date_formatter.php, line 85] > > Warning (2): implode() [function.implode]: Invalid arguments passed > [APP\models\behaviors\date_formatter.php, line 92] > ***************************************** > > So... Can I control that save() operation don't make any translation > with date? Otherwise, I don't understand what's going wrong ... > > The problem is on this instruction: $date_array = > explode($delimiterDateFormat, $date[0]); > > Is trying to explode a date in format dd-mm-yyyy with delimiter "/", I > know that the easy solution is change delimiter (obviously :D), I lose > all date logic translation on entire web... > > any suggestion?
First, you should probably take this up with whomever wrote the behavior. I haven't seen it myself, but you should be able to just change the model's behavior settings before saving. $delimiterDateFormat should be configurable. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
