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
All confirm() calls in console commands default to true if 1. the controller doesn't manually check for interactivity and 2. interactive = false (pipe stdin or CLI option).
Steps to reproduce
Run php craft users/create --email [email protected] --username User --groups Group --interactive 0
The result is an activated, admin user, which is different from the prompt's default (not activated since no password specified, not admin).
This is due to a bad behavior in Yii's console helper: when non-interactive, confirm will always return true instead of the specified default value. I don't think this is desirable for Craft, so it might makes sense to create a helper in Craft's controller class that does not have this behavior.
Craft CMS version
4.1.4.1
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
No response
The text was updated successfully, but these errors were encountered:
Agree that’s not ideal. It’s a slight behavior change so I’ve just started ignoring certain confirm()s for non-interactive shells, for Craft 4.2 (imminent).
What happened?
Description
All
confirm()
calls in console commands default to true if 1. the controller doesn't manually check for interactivity and 2. interactive = false (pipe stdin or CLI option).Steps to reproduce
php craft users/create --email [email protected] --username User --groups Group --interactive 0
This is due to a bad behavior in Yii's console helper: when non-interactive,
confirm
will always returntrue
instead of the specified default value. I don't think this is desirable for Craft, so it might makes sense to create a helper in Craft's controller class that does not have this behavior.Craft CMS version
4.1.4.1
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
No response
The text was updated successfully, but these errors were encountered: