You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running any console commands which have a required or validated input that isn't included as a command line argument causes a prompt to appear asking the user for input. When this happens with a non-TTY stdin the prompt is immediately returned as empty which triggers a validation error and re-prompt resulting in an infinite loop.
This has caught me out in 2 places:
Running commands from CI
Running commands in docker without attaching a TTY
EDIT:
I stopped being lazy and tracked down the bug. It's actually in Yii here:
So maybe a Yii2 PR would be better than overriding the prompt() method...
Steps to reproduce
echo "loop" | ./craft install
Additional info
Craft version: 3.4
PHP version: 7.3
The text was updated successfully, but these errors were encountered:
mattgrayisok
changed the title
Running console commands with required input from in a non-TTY environment causes an infinite loop
Running console commands with required input with a non-TTY stdin causes an infinite loop
May 24, 2020
Description
Running any console commands which have a required or validated input that isn't included as a command line argument causes a prompt to appear asking the user for input. When this happens with a non-TTY stdin the prompt is immediately returned as empty which triggers a validation error and re-prompt resulting in an infinite loop.
This has caught me out in 2 places:
EDIT:
I stopped being lazy and tracked down the bug. It's actually in Yii here:
https://github.com/yiisoft/yii2/blob/master/framework/helpers/BaseConsole.php#L800
(Nice to see an oldschool
goto
in there)So maybe a Yii2 PR would be better than overriding the prompt() method...
Steps to reproduce
Additional info
The text was updated successfully, but these errors were encountered: