Re: Cake won't save data in $this->data (data relationship weirdness)

2010-04-15 Thread Johnny Ferguson
Okay, I feel like an idiot. I said: $this->PracticeInstance->save(); instead of: $this->PracticeInstance->save($this->data); foolish me. The datetime fields were autopopulating because a record was being inserted, but it had no data and those are the only fields that get filled automatically. Ev

Re: Cake won't save data in $this->data (data relationship weirdness)

2010-04-15 Thread Johnny Ferguson
a beforeSave() in the model yields: app/models/practice_instance.php (line 6) Array ( [PracticeInstance] => Array ( [modified] => 2010-04-15 15:26:21 [created] => 2010-04-15 15:26:21 ) ) --- So somehow cake is rejecting members of $this->data /app/c

Re: Cake won't save data in $this->data (data relationship weirdness)

2010-04-15 Thread Jeremy Burns
Hmmm. If you don't have any validation rules my code isn't entirely applicable, but I'd still do this: >>> if ($this->PracticeInstance->save($this->data['PracticeInstance'])): >>> --do something >>> else: >>> die(debug($this->data)); >>> endif; At least you'll find out if Cake t

Re: Cake won't save data in $this->data (data relationship weirdness)

2010-04-14 Thread Johnny Ferguson
Now this is interesting: 100415 0:39:30 159 Connect acc...@localhost on 159 Init DB dev_practicelog 159 Query SHOW TABLES FROM `dev_practicelog` 159 Query DESCRIBE `practice_instances` 159 Query DESCRIBE `pr

Re: Cake won't save data in $this->data (data relationship weirdness)

2010-04-14 Thread Johnny Ferguson
If I put the data in manually it sticks. I don't have any validation rules. I'll try the code you recommended. I suppose at least if what I'm doing SHOULD work (can you confirm this?), then I can look through my sql logs and see what's happening. On Apr 15, 2:00 am, Jeremy Burns wrote: > Odd.

Re: Cake won't save data in $this->data (data relationship weirdness)

2010-04-14 Thread Jeremy Burns
Odd. What happens when you put the data straight into the table without Cake? What are the data types of the fields? Do you have any validation rules in your PracticeInstance model? If not (I have experienced this before) it passes Cake validation but fails at the database level, tricking Cake

Cake won't save data in $this->data (data relationship weirdness)

2010-04-14 Thread Johnny Ferguson
Hi, I'm developing an app that has database relationships. The table in question is like so: tbl practice_instances id - int (primary) created - timestamp (default: null) modified - timestamp (default: null) timeminutes - int practice_session_id - int practice_item_id - int tempostart - int temp