magento2: ./bin/magento config:show returns "Configuration for path: '...' doesn't exist" if config value equals to 0 or empty string
Preconditions (*)
- Magento 2.4-develop
- Create module
Vendor_Module - Create
etc/config.xmlin created moduleVendor_Modulewith new config pathdefault/vendor_module/general/valuewith value0or''(empty string)
Steps to reproduce (*)
- Open magento cli and run command
./bin/magento config:show vendor_module/general/value
Expected result (*)
- Should return
0or''(empty string)
Actual result (*)
- Command returns
Configuration for path: "vendor_module/general/value" doesn't exist
I think it happens because there <magento_root>/vendor/magento/module-config/Console/Command/ConfigShowCommand.php:153 magento checks if value is empty and if it actualy is the error message is shown. But empty value does not mean that path does not exist. So we should check if path exist in different method.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 20 (12 by maintainers)
Commits related to this issue
- Fixed #23290 — committed to opencommerce/magento2 by deleted user 5 years ago
- Fixed #23290 — committed to opencommerce/magento2 by deleted user 5 years ago
Hi @milindsingh It is confusing when you try to get value from path but you got “path does not exist”. I think at least the message should not say “does not exist” because it does exist but has empty value