-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] Fix global console flag when used in chain #24987
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
[Console] Fix global console flag when used in chain #24987
Conversation
52a6cc2
to
6938a0a
Compare
For 2.7? |
Yes I will rebase it :)
Le jeu. 16 nov. 2017 à 16:18, Robin Chalas <notifications@github.com> a
écrit :
… For 2.7?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#24987 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADSq8mGwVKCDC_Tw8D0aRjwEFe0DKJ5Rks5s3EQ2gaJpZM4QgEfq>
.
|
6938a0a
to
363cbaf
Compare
@@ -168,12 +168,12 @@ private function parseArgument($token) | |||
$arg = $this->definition->getArgument($c); | |||
$this->arguments[$arg->getName()] = $arg->isArray() ? array($token) : $token; | |||
|
|||
// if last argument isArray(), append token to last argument | |||
// if last argument isArray(), append token to last argument |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes please
@@ -282,6 +282,14 @@ public function hasParameterOption($values) | |||
if ($token === $value || 0 === strpos($token, $value.'=')) { | |||
return true; | |||
} | |||
|
|||
if (0 === strpos($token, '-') && 0 !== strpos($token, '--')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont follow it really, but it works 👍
$ bin/console router:match -hq
before: exception (missing argument)
after: quiet :)
} elseif ($this->definition->hasArgument($c - 1) && $this->definition->getArgument($c - 1)->isArray()) { | ||
$arg = $this->definition->getArgument($c - 1); | ||
$this->arguments[$arg->getName()][] = $token; | ||
|
||
// unexpected argument | ||
// unexpected argument |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
ffb69d5
to
70f1d96
Compare
70f1d96
to
1f8db73
Compare
Thanks for fixing this bug Hamza. |
…erfit) This PR was merged into the 2.7 branch. Discussion ---------- [Console] Fix global console flag when used in chain | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no | Deprecations? | no <!-- don't forget to update UPGRADE-*.md files --> | Tests pass? | yes | Fixed tickets | #23876 | License | MIT | Doc PR | Because SymfonyCon is great we can create pull request in it ! (this was preparer in the plane and I can push it just right now ;)) Finished in the #SymfonyConHackday2017 Commits ------- 1f8db73 [Console] Fix global console flag when used in chain
@fabpot This results in a bug in v2.8.32. When I try to run a command the command is not actually executed but the Symfony shell is opened (same result as with adding the --shell option). |
I will try to reproduce then fix this behaviour. Could you try to provide a
reproducer ?
Le mer. 13 déc. 2017 à 15:40, John Zwarthoed <notifications@github.com> a
écrit :
… @fabpot <https://github.com/fabpot> This results in a bug in v2.8.32.
When I try to run a command the command is not actually executed but the
Symfony shell is opened (same result as with adding the --shell option).
Did not check other releases though.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#24987 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADSq8mpnV9LEOa67zaURyoqxMDk9XbE0ks5s_-HtgaJpZM4QgEfq>
.
|
Just running app/console already causes the issue for me (with symfony/console 2.8.32) |
I've just tested with symfony/console 2.8.32 and I can't reproduce the problem :
|
Welcome to the Symfony shell (2.8.32 - app/dev/debug). At the prompt, type help for some help, To exit the shell, type ^D. Symfony > Thats what i mean. You’re not supposed to be stuck in de symfony shell after running a command if i’m not mistaken. |
Oh wait, thats with —shell. I’ll check when i’m home |
Apparently it only occurs when running with 'test' in the environment. |
I am able to reproduce it on a fresh project:
Not able to reproduce in 3.4 |
Ok I understand it, I submit a PR to fix the bug |
… alias (Simperfit) This PR was merged into the 2.7 branch. Discussion ---------- [Console] Fix a bug when passing a letter that could be an alias | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no | Deprecations? | no <!-- don't forget to update UPGRADE-*.md files --> | Tests pass? | yes | Fixed tickets | see #24987 (comment) | License | MIT | Doc PR | Fixing the global in console commands I've introduced a bug where when you pass -e=test it finds it a --shell, this fix the wrong behaviour. cc @Zwartpet Commits ------- a8871de [Console] Fix a bug when passing a letter that could be an alias
…arameterOption.
reverted |
* 2.7: [HttpFoundation] Use the correct syntax for session gc based on Pdo driver Revert "bug #24987 [Console] Fix global console flag when used in chain (Simperfit)" Revert "bug #25487 [Console] Fix a bug when passing a letter that could be an alias (Simperfit)" Disable CSP header on exception pages only in debug Fixed submitting disabled buttons Fixed Button::setParent() when already submitted Improve assertions SCA: get rid of repetitive calls allow null values for root nodes in YAML configs [VarDumper] Fix docblock Improve phpdoc to make it more explicit
* 2.8: [HttpFoundation] Use the correct syntax for session gc based on Pdo driver Removed assertDateTimeEquals() methods. Revert "bug #24987 [Console] Fix global console flag when used in chain (Simperfit)" Revert "bug #25487 [Console] Fix a bug when passing a letter that could be an alias (Simperfit)" Disable CSP header on exception pages only in debug Fixed submitting disabled buttons Fixed Button::setParent() when already submitted Improve assertions Improve assertions SCA: get rid of repetitive calls allow null values for root nodes in YAML configs [VarDumper] Fix docblock Improve phpdoc to make it more explicit
* 3.3: [HttpFoundation] Use the correct syntax for session gc based on Pdo driver Removed assertDateTimeEquals() methods. Revert "bug #24987 [Console] Fix global console flag when used in chain (Simperfit)" Revert "bug #25487 [Console] Fix a bug when passing a letter that could be an alias (Simperfit)" Disable CSP header on exception pages only in debug Fixed submitting disabled buttons Fixed Button::setParent() when already submitted Improve assertions Restore RoleInterface import Improve assertions SCA: get rid of repetitive calls allow null values for root nodes in YAML configs revert useless tests fixtures changes [VarDumper] Fix docblock Improve phpdoc to make it more explicit
* 3.4: [HttpFoundation] Use the correct syntax for session gc based on Pdo driver Removed assertDateTimeEquals() methods. Revert "bug #24987 [Console] Fix global console flag when used in chain (Simperfit)" Revert "bug #25487 [Console] Fix a bug when passing a letter that could be an alias (Simperfit)" Disable CSP header on exception pages only in debug Fixed submitting disabled buttons Fixed Button::setParent() when already submitted Improve assertions Restore RoleInterface import [Console] Provide a bugfix where an array could be passed Improve assertions SCA: get rid of repetitive calls allow null values for root nodes in YAML configs revert useless tests fixtures changes [VarDumper] Fix docblock Improve phpdoc to make it more explicit [DI] Fix initialization of legacy containers by delaying include_once
* 4.0: [HttpFoundation] Use the correct syntax for session gc based on Pdo driver Removed assertDateTimeEquals() methods. Revert "bug #24987 [Console] Fix global console flag when used in chain (Simperfit)" Revert "bug #25487 [Console] Fix a bug when passing a letter that could be an alias (Simperfit)" Disable CSP header on exception pages only in debug Fixed submitting disabled buttons Fixed Button::setParent() when already submitted Improve assertions Restore RoleInterface import [Console] Provide a bugfix where an array could be passed Improve assertions SCA: get rid of repetitive calls allow null values for root nodes in YAML configs revert useless tests fixtures changes [VarDumper] Fix docblock Improve phpdoc to make it more explicit [DI] Fix initialization of legacy containers by delaying include_once
… used with multiple flags (greg-1-anderson) This PR was merged into the 2.7 branch. Discussion ---------- [Console] Fix hasParameterOption / getParameterOption when used with multiple flags | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no (Fixes BC break in #24987) | Deprecations? | no | Tests pass? | yes | Fixed tickets | #25825 | License | MIT | Doc PR | n/a Proposed resolution to #25825: - Back out #24987 - Fix getParameterOption for short options with values, e.g. `-edev` Commits ------- 35f98e2 Follow-on to #25825: Fix edge case in getParameterOption.
Because SymfonyCon is great we can create pull request in it ! (this was preparer in the plane and I can push it just right now ;))
Finished in the #SymfonyConHackday2017