Advertisement
Guest User

Untitled

a guest
Nov 11th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. public function addAction(Request $request)
  2. {
  3. $user = $this->get('security.token_storage')->getToken()->getUser();
  4. $em = $this->getDoctrine()->getManager();
  5. $post = new Post();
  6. $form = $this->createForm(PostType::class, $post);
  7. $form->handleRequest($request);
  8. if ($form->isValid()) {
  9. $sn = random_int(1000000, 9999999);
  10. $post->setSn($sn);
  11. $post->setCreator($user);
  12. $em->persist($post);
  13. $em->flush();
  14. return $this->redirectToRoute('_user_post');
  15. }
  16. return $this->render('frontend/user/post/form/post-add.html.twig', array(
  17. 'form' => $form->createView()
  18. ));
  19. }
  20.  
  21. request.CRITICAL: Uncaught PHP Exception DoctrineDBALExceptionNotNullConstraintViolationException: "An exception occurred while executing 'UPDATE dzb_user SET password = ? WHERE id = ?' with params [null, 1]: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'password' cannot be null" at /****/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 112 {"exception":"[object] (Doctrine\DBAL\Exception\NotNullConstraintViolationException(code: 0): An exception occurred while executing 'UPDATE dzb_user SET password = ? WHERE id = ?' with params [null, 1]:nnSQLSTATE[23000]: Integrity constraint violation: 1048 Column 'password' cannot be null at /****/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:112, Doctrine\DBAL\Driver\PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'password' cannot be null at /home/antcto/public_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:93, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'password' cannot be null at /****/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:91)"} []
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement