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

Command with confirmToProceed run in production without --force flag #43332

Closed
hmazter opened this issue Jul 21, 2022 · 2 comments · Fixed by #43334
Closed

Command with confirmToProceed run in production without --force flag #43332

hmazter opened this issue Jul 21, 2022 · 2 comments · Fixed by #43334

Comments

@hmazter
Copy link
Contributor

hmazter commented Jul 21, 2022

  • Laravel Version: 9.21.3
  • PHP Version: 8.1.7
  • Database Driver & Version: MySQL 5.7

Description:

Artisan commands that uses the ConfirmableTrait::confirmToProceed method are executed in a production environment without interaction even though --force is not passed.

Steps To Reproduce:

In a fresh install of Laravel (9.21.3) run the following command:

APP_ENV=production php artisan migrate --no-interaction

I expect that command to be aborted.

But the command proceeds with the migration even though no --force was passed.
This is the output I get:
Screenshot 2022-07-21 at 10 13 40

@hmazter
Copy link
Contributor Author

hmazter commented Jul 21, 2022

After some short digging, I can see that the Confirm Component returns true since that is the "default answer":

public function render($question, $default = true)

I think false was the default in versions before the artisan view Components were introduced:

public function confirm($question, $default = false)

@driesvints
Copy link
Member

We've sent in a PR for this and hope to do a new release as soon as we're able. Thanks!

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

Successfully merging a pull request may close this issue.

2 participants