What I would do to verify this behavior is to debug the model itself (Cake library). Just copy the original to a second file for safe keeping and start digging. I would step debug statements through the save() method and see if I could determine whether the beforeSave is called. Looking at the code itself, I would say that beforeSave is always called and it only procedes with the full save if the method returns a value.
If you find that something odd is happening here, then search the Trac for beforeSave bugs and see if you find any. There may be workarounds or bugfixes already posted that relate to your issues. Some other things that I thought of: 1) Did you override save() in your model or app_model? 2) Did you debug the beforeSave in the calling model to see if its somehow retriggering? 3) Do you have a beforeSave in your app_model? Is it triggering? Good luck, Fred Joshua McFarren wrote: > Hi Aran, > > Thanks for the advice. Unfortunately I tried that and it doesn't make > a difference. The syntax i tried is: > > $this->ProjectTasks->create(); > $this->ProjectTasks->save($task); > > In either case the save method does update the row in the DB but the > callbacks don't happen. > > Any other ideas? > > - Joshua > > On Apr 17, 7:46 pm, aranworld <[EMAIL PROTECTED]> wrote: > >> Try putting: >> >> $this->ProjectTasks->create(); >> >> in each loop of the foreach in Schedule::afterSave() >> >> When you call save() multiple times on the same model, I have found >> that I run into problems if I don't call create() in between each call >> to save(). >> > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~----------~----~----~----~------~----~------~--~---
