maker-bundle: make:entity fails in 5.1.3 / wrong doctrine version?

Not sure if the right repository to report the issue:

Steps to reproduce:

symfony new sso2 --full

...
                                                                                                                        
 [OK] Your project is now ready in /Users/admin/PhpstormProjects/sso2                                                   

cd sso2
vim .env // Just setup Database
bin/console make:user

 ... (everything answered with yes)

 created: src/Entity/User.php
 created: src/Repository/UserRepository.php
 updated: src/Entity/User.php
 updated: config/packages/security.yaml

Success! 

 Next Steps:
   - Review your new App\Entity\User class.
   - Use make:entity to add more fields to your User entity and then run make:migration.
   - Create a way to authenticate! See https://symfony.com/doc/current/security.html

Now the important part:

bin/console make:entity

 Class name of the entity to create or update (e.g. BraveElephant):
 > User

 Your entity already exists! So let's add some new fields!

 New property name (press <return> to stop adding fields):
 > active

In Validator.php line 158:
                                                                                                                                                                                                                                      
  Argument 2 passed to Symfony\Bundle\MakerBundle\Validator::validateDoctrineFieldName() must be an instance of Doctrine\Common\Persistence\ManagerRegistry, instance of Doctrine\Bundle\DoctrineBundle\Registry given, called in /U  
  sers/admin/PhpstormProjects/sso2/vendor/symfony/maker-bundle/src/Maker/MakeEntity.php on line 303                                                                                                                                   
                                                                                                                                                                                                                                      

make:entity [-a|--api-resource] [--regenerate] [--overwrite] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command> [<name>]```

Happens on every entity.

When open the project in a browser: 

Argument 1 passed to Argument 1 passed to Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter::__construct() must be an instance of Doctrine\Common\Persistence\ManagerRegistry or null, instance of Doctrine\Bundle\DoctrineBundle\Registry given ...

appears.

Looks to me like almost the same - wrong Doctrine version is installed with "the new project command" or so?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (4 by maintainers)

Commits related to this issue

Most upvoted comments

setting: “doctrine/doctrine-bundle”: “2.0.*”, and “sensio/framework-extra-bundle”: “^5.6”,

in the composer.json helps for first.

So if I understand correctly the solution would be to change “doctrine / doctrine-bundle”: “^ 2.1” in “doctrine / doctrine-bundle”: “^ 2.1.0”?