From 6180e29f40a3f141e908dd9df3b1e589ef796eb5 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 56751f2188411..0802f17aeba5b 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; }