Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.11][Command] The "connection" option does not exist. #976

Closed
EfeloPHP opened this issue May 29, 2019 · 4 comments
Closed

[1.11][Command] The "connection" option does not exist. #976

EfeloPHP opened this issue May 29, 2019 · 4 comments
Assignees
Labels
Milestone

Comments

@EfeloPHP
Copy link

Since 1.11 the commands "doctrine:cache:clear-***-region" don't work anymore.

Reproduced with fresh install :

composer require symfony/flex
composer require symfony/yaml symfony/dotenv
composer require orm
florian@florian-linux:~/Test$ ./bin/console doctrine:cache:clear-collection-region --all
                                    
  The "connection" option does not exist.  
                                           
doctrine:cache:clear-collection-region [--all] [--flush] [--em [EM]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command> [<owner-class> [<association> [<owner-id>]]]

florian@florian-linux:~/Test/Symfony$ ./bin/console doctrine:cache:clear-entity-region --all                                                                                                                                                    
                                                                                                                                                            
  The "connection" option does not exist.                                                                                                                   
                                                                                                                                                                                                                                                                                                                  
doctrine:cache:clear-entity-region [--all] [--flush] [--em [EM]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command> [<entity-class> [<entity-id>]]                                                                     
                                                                                                                                                            
florian@florian-linux:~/Test$ ./bin/console doctrine:cache:clear-query-region --all                                                                                                                                                                                                                 
                                                                                                                                                            
  The "connection" option does not exist.                                                                                                                   
                                                                                                                                                                                                                                                                                                            
doctrine:cache:clear-query-region [--all] [--flush] [--em [EM]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command> [<region-name>]                                                                                                                                                                                                                               
@SenseException
Copy link
Member

SenseException commented Jun 1, 2019

Thank you for reporting this issue. Looks like the transition between 1.10 and 1.11 from entity manager name and connection name didn't went well.

@EfeloPHP
Copy link
Author

EfeloPHP commented Jun 3, 2019

The bug was introduced in this commit :
0a5fd39#diff-182618bc6e201d31a426dee5692f5b35

I would like to submit a fix, but I am not sure what the problem is :

  1. should there be a "connection" option instead of "em"
  2. shoud this line :
DoctrineCommandHelper::setApplicationConnection($this->getApplication(), $input->getOption('connection'));

be replaced by this one :

DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em'));

@SenseException
Copy link
Member

A connection is used through the commands while em seems to have no use.

@alcaeus When DelegateCommand was inherited, an entity manager name was used. I assume that it is supposed to be a connection name now and that em has to be replaced with connection?

alcaeus added a commit to alcaeus/DoctrineBundle that referenced this issue Jun 4, 2019
Fixes an issue reported in doctrine#976, previously introduced in doctrine#892.
@alcaeus alcaeus self-assigned this Jun 4, 2019
@alcaeus alcaeus added this to the 1.11.2 milestone Jun 4, 2019
@alcaeus alcaeus added this to 1.11 in Roadmap Jun 4, 2019
@alcaeus
Copy link
Member

alcaeus commented Jun 4, 2019

Fixed in #979.

@alcaeus alcaeus closed this as completed Jun 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants