magento2: ./bin/magento config:show returns "Configuration for path: '...' doesn't exist" if config value equals to 0 or empty string

Preconditions (*)

  1. Magento 2.4-develop
  2. Create module Vendor_Module
  3. Create etc/config.xml in created module Vendor_Module with new config path default/vendor_module/general/value with value 0 or '' (empty string)

Steps to reproduce (*)

  1. Open magento cli and run command ./bin/magento config:show vendor_module/general/value

Expected result (*)

  1. Should return 0 or '' (empty string)

Actual result (*)

  1. 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

Most upvoted comments

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