Description
Preconditions and environment
- Magento version: 2.4.7-p2
- Default magento example project.
Steps to reproduce
- Create a new Magento project
- Enable Xdebug or any other tool to debug the CLI process
- Setup breakpoint in the execute function of the command you want to run.
- Execute command with the --magento-init-params option.
For my command I used the setup:upgrade command with the init params following the example.
magento setup:upgrade --magento-init-params="MAGE_MODE=production"
I also tried to run it without "In both instances, the command is run, but the params never change," following the exact example given when running setup:upgrade --help.
Expected result
I expect a change in the MAGE_MODE to production instead of development.
Actual result
Additional information
I placed a breakpoint in the framework/console/Cli.php file on line 82. On line 81, a variable named $application is created, which contains another variable called serviceManager. Inside serviceManager, there is an array called services. Within this array is a key named config, which includes a key called magento-init-params. This key, in turn, contains argv, where the entire command is present.
This confirms that the parameters are correctly passed to the serviceManager, but they are not being utilized for some reason.
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.