Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function addAction(Request $request)
- {
- $user = $this->get('security.token_storage')->getToken()->getUser();
- $em = $this->getDoctrine()->getManager();
- $post = new Post();
- $form = $this->createForm(PostType::class, $post);
- $form->handleRequest($request);
- if ($form->isValid()) {
- $sn = random_int(1000000, 9999999);
- $post->setSn($sn);
- $post->setCreator($user);
- $em->persist($post);
- $em->flush();
- return $this->redirectToRoute('_user_post');
- }
- return $this->render('frontend/user/post/form/post-add.html.twig', array(
- 'form' => $form->createView()
- ));
- }
- 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