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

Symfony 3.2.5 breaks validation for Console options w/ required values #22050

Closed
greg-1-anderson opened this issue Mar 17, 2017 · 1 comment
Closed

Comments

@greg-1-anderson
Copy link
Contributor

Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.2.5, 3.2.6

In Symfony Console version 3.2.4 and earlier, options with required values were validated correctly. For example:

$ ./robo -f examples/ try:opt-required --foo                                              
  [Symfony\Component\Console\Exception\RuntimeException]  
  The "--foo" option requires a value.                    

In Symfony Console version 3.2.5, this validation step is skipped.

I have verified this in multiple Symfony Console applications, which all break in the same way when upgrading to version 3.2.5.

I have also confirmed that commenting out the line $command->setInputBound(true); in Application.php fixes the symptom. Removing this optimization is not the proposed solution; this is just as far as I got in terms of isolation.

Workaround:

  • Call $input->bind($command->getDefinition()); in an event subscriber (probably not a great idea)
  • Pin Symfony/Console to 3.2.4 in composer.json
@chalasr
Copy link
Member

chalasr commented Mar 18, 2017

@greg-1-anderson See #21953 and #22027

fabpot added a commit that referenced this issue Mar 22, 2017
…ade from console.command event (chalasr)" (chalasr)

This PR was merged into the 2.8 branch.

Discussion
----------

Revert "bug #21841 [Console] Do not squash input changes made from console.command event (chalasr)"

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #21953, #22050
| License       | MIT
| Doc PR        | n/a

A bit frustrated to revert this change since the BC break report lacks of information, making us unable to reproduce nor to look at improving the situation.
I'm going to re-propose this on master, covering the BC break that is identified, fixed and tested using the changes made in #21953. That will let the choice for the reporter to upgrade using the 1 required LOC.

Commits
-------

5af47c4 Revert "bug #21841 [Console] Do not squash input changes made from console.command event (chalasr)"
@fabpot fabpot closed this as completed Mar 22, 2017
symfony-splitter pushed a commit to symfony/console that referenced this issue Mar 22, 2017
…ade from console.command event (chalasr)" (chalasr)

This PR was merged into the 2.8 branch.

Discussion
----------

Revert "bug #21841 [Console] Do not squash input changes made from console.command event (chalasr)"

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #21953, symfony/symfony#22050
| License       | MIT
| Doc PR        | n/a

A bit frustrated to revert this change since the BC break report lacks of information, making us unable to reproduce nor to look at improving the situation.
I'm going to re-propose this on master, covering the BC break that is identified, fixed and tested using the changes made in #21953. That will let the choice for the reporter to upgrade using the 1 required LOC.

Commits
-------

5af47c40dc Revert "bug #21841 [Console] Do not squash input changes made from console.command event (chalasr)"
pjcdawkins added a commit to platformsh/legacy-cli that referenced this issue Apr 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants