Re: app attempting to insert records rather than update

2009-06-22 Thread Jon Chin
Thanks, Brian for all your input. I agree, the code was pretty difficult to understand. After spending tons of time staring at the code, I realized there was a simpler and more correct way to do it. I rewrote it and it's working for the most part now. I still have to work out a few kinks, t

Re: app attempting to insert records rather than update

2009-06-20 Thread brian
That's a bit difficult to follow. At what point are you calling _processMerit()? And you have an empty block inside wizard()? Is that on purpose? You have a couple of instances with $this->Merit->save($this->data) but I only see where you're reading data from the DB for Application. hich model ar

Re: app attempting to insert records rather than update

2009-06-19 Thread Jon Chin
Here's the code. I still can't get it to update rather than insert. What am I doing wrong? function beforeFilter() { $this->Wizard->steps = array('profile', 'merit', 'finance', 'education', 'endorsement'); } function wizard($step = null) { if(isset($this->passedArgs['1']) ||

Re: app attempting to insert records rather than update

2009-06-19 Thread brian
On Fri, Jun 19, 2009 at 2:04 AM, Jon Chin wrote: > > Thanks for the tip.  Sadly, I'm still having problems with it.  When I > add input('id');?> to the view, all it does is generate type="hidden" name="data[Application][id]" value="" id="ApplicationId" > /> which doesn't change anything in my con

Re: app attempting to insert records rather than update

2009-06-19 Thread Mauricio Morales
What get you printed out doing a print_r($data) just before the: if ($this->Merit->save($this->data)) {return true;} ? What if you save the ID manually into $this->data ? $this->data['Application']['id'] = yourIDFromYourSession(); --~--~-~--~~~---~--~~ You receiv

Re: app attempting to insert records rather than update

2009-06-18 Thread Jon Chin
Thanks for the tip. Sadly, I'm still having problems with it. When I add input('id');?> to the view, all it does is generate which doesn't change anything in my controller when I print the contents of $this->data. I also tried making the field called application_id in the form, but it didn'

Re: app attempting to insert records rather than update

2009-06-18 Thread rich...@home
Forget about storing the id in a session and just include the field in the form. Cake will automatically hide it from the user. On Jun 18, 8:55 am, Jon Chin wrote: > I'm building a scholarship application using Cake.  I have an > Application model and a Merit model and I'm using a wizard compone

app attempting to insert records rather than update

2009-06-18 Thread Jon Chin
I'm building a scholarship application using Cake. I have an Application model and a Merit model and I'm using a wizard component I picked up from the Bakery. The Application model has a hasOne relationship to Merit. I want my users to be able to come back to edit the stuff they've already