From 4700853d5687c21ebbf97bf18a06049c63e7ee6b Mon Sep 17 00:00:00 2001 From: Jeroen Date: Wed, 14 Feb 2018 12:18:29 +0100 Subject: [PATCH] Update Store getConfig() to respect valid false return value Using a config setting Yes/No will return string '0' when No is saved. Method will therefore fetch default config value because '0' equals false. --- app/code/Magento/Store/Model/Store.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Store/Model/Store.php b/app/code/Magento/Store/Model/Store.php index 34d338b1b3448..078da6d63ba6c 100644 --- a/app/code/Magento/Store/Model/Store.php +++ b/app/code/Magento/Store/Model/Store.php @@ -535,8 +535,8 @@ public function setName($name) public function getConfig($path) { $data = $this->_config->getValue($path, ScopeInterface::SCOPE_STORE, $this->getCode()); - if (!$data) { - $data = $this->_config->getValue($path, ScopeConfigInterface::SCOPE_TYPE_DEFAULT); + if ($data === null) { + $data = $this->_config->getValue($path); } return $data === false ? null : $data; }