I'm attempting to duplicate the Vokuro security application. With the difference that my database is in PostgreSQL instead of MySQL.
When attempting to sign-up I'm creating a user. But when I attempt to save the user, the application dies and will not progress further. The super odd thing is that the user actually is saved in the database. I can query the DB manually and find the newly created user.
Here is my code I'm using to attempt to debug this problem. (notice all of my ugly echo statements)
public function signupAction()
{
echo 'signupaction';
$form = new SignUpForm();
if ($this->request->isPost()) {
echo 'ispost';
if ($form->isValid($this->request->getPost()) != false) {
echo 'isvalid';
$user = new Users();
echo 'madeUser';
$user->assign(array(
'name' => $this->request->getPost('name', 'striptags'),
'email' => $this->request->getPost('email'),
'password' => $this->security->hash($this->request->getPost('password')),
'profile_id' => 2
));
echo 'assignedUser';
$savedBool = $user->save();
echo '<br> User saved = ';
echo $savedBool;
if ($savedBool) {
echo 'user saved';
return $this->dispatcher->forward(array(
'controller' => 'index',
'action' => 'index'
));
} else {
echo 'user save failed';
$messages = '';
foreach ($user->getMessages() as $message) {
$messages .= $message->getMessage();
}
$this->flash->error('An error occured, unable to register. Reason: ' . $messages);
echo $messages;
}
$this->flash->error($user->getMessages());
}
}
$this->view->form = $form;
}
Now this is EXACTLY what my application is printing out.
signupactionispostisvalidmadeUserassignedUser
So I hit my echo statement for "assignedUser" Then I run the save() function on $user. And my application dies. It doesn't reach the next echo statement.
I'm at a loss and I'm not sure what's wrong here. Since the user actually was sent to the database. I set up a query logger and the insert statement is being run correctly. Why would the application die here?