So your model is just not saving the record, maybe failing validation, not 
returning true from your before filter or something similar?

Hard to know without seeing the data that you are passing in, or your model, 
just a couple ideas?!

 

From: [email protected] [mailto:[email protected]] On Behalf Of 
Louie Miranda
Sent: Tuesday, January 13, 2009 2:05 PM
To: CakePHP
Subject: Not saving, how to debug more?

 

Hello CakePHP!

I have a little problem on my code. I have this function that upon trigger will 
activate and $id and change the status to "New". However, when doing this - the 
application is always doing the "else" part "The order could not be activated".

I am monitoring the SQL logs and no query has been executed only the desc on 
the table. Debug 2 is also selected on core.php.

How could I see why is this not working?
 

function activate($id = null)
{
    $this->checkSession();
    if (!$id) {
        $this->Session->setFlash('Invalid Cancel Id request.');
        $this->redirect(array('action'=>'index'), null, true);
    }
    else
    {
        if ($this->Card->save($this->data)) {
                $CancelStatus = "New";
                $this->data['Card']['status'] = $CancelStatus;
            $this->Card->save($this->data);
            $this->Session->setFlash('The order is now active.');
            $this->redirect($this->referer());
        } else {
            $this->Session->setFlash('The order could not be activated.');
            $this->redirect($this->referer());
        }
    }
}


Help!

--
Louie Miranda ([email protected])
http://www.louiemiranda.net

Security Is A Series Of Well-Defined Steps
chmod -R 0 / ; and smile :)



No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.176 / Virus Database: 270.10.6/1888 - Release Date: 1/12/2009 7:04 
AM


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to