Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8885213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:15:13+00:00 2026-06-14T21:15:13+00:00

I am using FOSUserBundle. In my project, I created my own UserBundle and overrode

  • 0

I am using FOSUserBundle.
In my project, I created my own UserBundle and overrode the controller, the forms and the handlers.
Now when a user tries to register with an existing email, the site crashes (email is unique for doctrine). It seems like there is no validation made.
I thought there would be some validation as I have in my validation.yml:

YOP\UserBundle\Entity\User:
  constraints:
    - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity: email
  properties:
    email:
      - Email: ~

How come the validation isn’t made on the email field?
How can I make sure that my validation constraints are taken into account?

PS: the validation.yml file is not in my UserBundle, is that a problem?

EDIT:

the code of my UserBundle is available here
I don’t understand why there is no validation done anymore…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T21:15:14+00:00Added an answer on June 14, 2026 at 9:15 pm

    Solved the issue by:

    • having the validation.yml file in the same bundle as the one containing my User entity, and pointing to my User Entity
    • adding the “Registration” validation group to my fields

    validation.yml:

    YOP\YourOwnPoetBundle\Entity\User:
      constraints:
        - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity: email
      properties:
        email:
          - Email: { groups: [Registration] }
        plainPassword:
          - MinLength: { limit: 5, message: "Your password must have at least {{ limit }} characters" }
        name:
          - NotBlank: { groups: [Registration] }
        familyName:
          - NotBlank: { groups: [Registration] }
        sex:
          - Choice: { choices: [1, 2], groups: [Registration] }
        birthdate:
          - NotNull: { groups: [Registration] }
        city:
          - NotBlank: { groups: [Registration] }
        howDidYouHear:
          - Choice: { choices: [1, 2, 3, 4, 5, 6, 7, 8], groups: [Registration] }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I´ve created my own user Bundle, extending FOSUserBundle. In my UserBundle, I have a
I'm using FOSUserBundle together with NnmMultiUserBundle. When a user register, using my form_handler, the
I have installed FOSUserBundle and I am using it in my project. Its login
Using FOSUserBundle and Symfony2, in my site, depending on the roles of the user
i'm using the FOSUserBundle and the FOSFacebookBundle (for version SF 2.0.x) in my project.
I'm using Symfony 2.1 for a project and FOSUserBundle to manage the users. I'm
I'm using FOSUserBundle to authenticate users from database and now I want add authentication
Our application is using Symfony 2.0 and MongoDB with FOSUserBundle for user management. Client
I installed FOSUserBundle and FOSFacebookBundle using this method : How to make a separate
I'm using Symfony2 with sonataAdminBundle, sonataUserBundle and FOSUserBundle. I would like to create a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.