Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use getStoreConfigFlag() instead of (bool)getStoreConfig() #2747

Merged
merged 2 commits into from
Nov 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/code/core/Mage/Admin/Model/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,6 @@ protected function _loginFailed($e, $request, $username, $message)
*/
protected function allowAdminSid()
{
return (bool) Mage::getStoreConfig(self::XML_PATH_ALLOW_SID_FOR_ADMIN_AREA);
return Mage::getStoreConfigFlag(self::XML_PATH_ALLOW_SID_FOR_ADMIN_AREA);
}
}
2 changes: 1 addition & 1 deletion app/code/core/Mage/Api/Model/Server/Adapter/Soap.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ protected function getWsdlUrl($params = null, $withAuth = true)
protected function _instantiateServer()
{
$apiConfigCharset = Mage::getStoreConfig('api/config/charset');
$wsdlCacheEnabled = (bool) Mage::getStoreConfig('api/config/wsdl_cache_enabled');
$wsdlCacheEnabled = Mage::getStoreConfigFlag('api/config/wsdl_cache_enabled');

if ($wsdlCacheEnabled) {
ini_set('soap.wsdl_cache_enabled', '1');
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Catalog/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ public function getOldFieldMap()
*/
public function isMsrpEnabled()
{
return (bool)Mage::getStoreConfig(self::XML_PATH_MSRP_ENABLED, $this->_storeId);
return Mage::getStoreConfigFlag(self::XML_PATH_MSRP_ENABLED, $this->_storeId);
}

/**
Expand All @@ -322,7 +322,7 @@ public function getMsrpDisplayActualPriceType()
*/
public function isMsrpApplyToAll()
{
return (bool)Mage::getStoreConfig(self::XML_PATH_MSRP_APPLY_TO_ALL, $this->_storeId);
return Mage::getStoreConfigFlag(self::XML_PATH_MSRP_APPLY_TO_ALL, $this->_storeId);
}

/**
Expand Down
10 changes: 5 additions & 5 deletions app/code/core/Mage/Checkout/Block/Cart/Shipping.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ public function getEstimateRegion()
*/
public function getCityActive()
{
return (bool)Mage::getStoreConfig('carriers/dhl/active')
|| (bool)Mage::getStoreConfig('carriers/dhlint/active');
return Mage::getStoreConfigFlag('carriers/dhl/active')
|| Mage::getStoreConfigFlag('carriers/dhlint/active');
}

/**
Expand All @@ -164,9 +164,9 @@ public function getCityActive()
*/
public function getStateActive()
{
return (bool)Mage::getStoreConfig('carriers/dhl/active')
|| (bool)Mage::getStoreConfig('carriers/tablerate/active')
|| (bool)Mage::getStoreConfig('carriers/dhlint/active');
return Mage::getStoreConfigFlag('carriers/dhl/active')
|| Mage::getStoreConfigFlag('carriers/tablerate/active')
|| Mage::getStoreConfigFlag('carriers/dhlint/active');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Checkout/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function getRequiredAgreementIds()
*/
public function canOnepageCheckout()
{
return (bool)Mage::getStoreConfig('checkout/options/onepage_checkout_enabled');
return Mage::getStoreConfigFlag('checkout/options/onepage_checkout_enabled');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/ConfigurableSwatches/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function isEnabled()
{
if (is_null($this->_enabled)) {
$this->_enabled = (
(bool) Mage::getStoreConfig(self::CONFIG_PATH_ENABLED)
Mage::getStoreConfigFlag(self::CONFIG_PATH_ENABLED)
&& Mage::helper('configurableswatches/productlist')->getSwatchAttribute()
);
}
Expand Down
16 changes: 8 additions & 8 deletions app/code/core/Mage/Customer/Helper/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ class Mage_Customer_Helper_Address extends Mage_Core_Helper_Abstract
/**
* VAT Validation parameters XML paths
*/
public const XML_PATH_VIV_DISABLE_AUTO_ASSIGN_DEFAULT = 'customer/create_account/viv_disable_auto_group_assign_default';
public const XML_PATH_VIV_ON_EACH_TRANSACTION = 'customer/create_account/viv_on_each_transaction';
public const XML_PATH_VAT_VALIDATION_ENABLED = 'customer/create_account/auto_group_assign';
public const XML_PATH_VIV_DISABLE_AUTO_ASSIGN_DEFAULT = 'customer/create_account/viv_disable_auto_group_assign_default';
public const XML_PATH_VIV_ON_EACH_TRANSACTION = 'customer/create_account/viv_on_each_transaction';
public const XML_PATH_VAT_VALIDATION_ENABLED = 'customer/create_account/auto_group_assign';
public const XML_PATH_VIV_TAX_CALCULATION_ADDRESS_TYPE = 'customer/create_account/tax_calculation_address_type';
public const XML_PATH_VAT_FRONTEND_VISIBILITY = 'customer/create_account/vat_frontend_visibility';
public const XML_PATH_VAT_FRONTEND_VISIBILITY = 'customer/create_account/vat_frontend_visibility';

protected $_moduleName = 'Mage_Customer';

Expand Down Expand Up @@ -246,7 +246,7 @@ public function convertStreetLines($origStreets, $toCount)
*/
public function isVatValidationEnabled($store = null)
{
return (bool)Mage::getStoreConfig(self::XML_PATH_VAT_VALIDATION_ENABLED, $store);
return Mage::getStoreConfigFlag(self::XML_PATH_VAT_VALIDATION_ENABLED, $store);
}

/**
Expand All @@ -256,7 +256,7 @@ public function isVatValidationEnabled($store = null)
*/
public function getDisableAutoGroupAssignDefaultValue()
{
return (bool)Mage::getStoreConfig(self::XML_PATH_VIV_DISABLE_AUTO_ASSIGN_DEFAULT);
return Mage::getStoreConfigFlag(self::XML_PATH_VIV_DISABLE_AUTO_ASSIGN_DEFAULT);
}

/**
Expand All @@ -267,7 +267,7 @@ public function getDisableAutoGroupAssignDefaultValue()
*/
public function getValidateOnEachTransaction($store = null)
{
return (bool)Mage::getStoreConfig(self::XML_PATH_VIV_ON_EACH_TRANSACTION, $store);
return Mage::getStoreConfigFlag(self::XML_PATH_VIV_ON_EACH_TRANSACTION, $store);
}

/**
Expand All @@ -288,6 +288,6 @@ public function getTaxCalculationAddressType($store = null)
*/
public function isVatAttributeVisible()
{
return (bool)Mage::getStoreConfig(self::XML_PATH_VAT_FRONTEND_VISIBILITY);
return Mage::getStoreConfigFlag(self::XML_PATH_VAT_FRONTEND_VISIBILITY);
}
}
2 changes: 1 addition & 1 deletion app/code/core/Mage/Customer/Model/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ public function isConfirmationRequired()
}
if (self::$_isConfirmationRequired === null) {
$storeId = $this->getStoreId() ?: null;
self::$_isConfirmationRequired = (bool)Mage::getStoreConfig(self::XML_PATH_IS_CONFIRM, $storeId);
self::$_isConfirmationRequired = Mage::getStoreConfigFlag(self::XML_PATH_IS_CONFIRM, $storeId);
}

return self::$_isConfirmationRequired;
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Directory/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public function getCountriesWithStatesRequired($asJson = false)
*/
public function getShowNonRequiredState()
{
return (bool)Mage::getStoreConfig(self::XML_PATH_DISPLAY_ALL_STATES);
return Mage::getStoreConfigFlag(self::XML_PATH_DISPLAY_ALL_STATES);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/PageCache/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Mage_PageCache_Helper_Data extends Mage_Core_Helper_Abstract
*/
public function isEnabled()
{
return (bool)Mage::getStoreConfig(self::XML_PATH_EXTERNAL_CACHE_ENABLED);
return Mage::getStoreConfigFlag(self::XML_PATH_EXTERNAL_CACHE_ENABLED);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions app/code/core/Mage/Rss/Block/List.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public function getRssMiscFeeds()
public function newProductRssFeed()
{
$path = self::XML_PATH_RSS_METHODS . '/catalog/new';
if ((bool)Mage::getStoreConfig($path)) {
if (Mage::getStoreConfigFlag($path)) {
$this->addRssFeed($path, $this->__('New Products'));
}
}
Expand All @@ -153,7 +153,7 @@ public function newProductRssFeed()
public function specialProductRssFeed()
{
$path = self::XML_PATH_RSS_METHODS . '/catalog/special';
if ((bool)Mage::getStoreConfig($path)) {
if (Mage::getStoreConfigFlag($path)) {
$this->addRssFeed($path, $this->__('Special Products'), [], true);
}
}
Expand All @@ -164,7 +164,7 @@ public function specialProductRssFeed()
public function salesRuleProductRssFeed()
{
$path = self::XML_PATH_RSS_METHODS . '/catalog/salesrule';
if ((bool)Mage::getStoreConfig($path)) {
if (Mage::getStoreConfigFlag($path)) {
$this->addRssFeed($path, $this->__('Coupons/Discounts'), [], true);
}
}
Expand All @@ -176,7 +176,7 @@ public function salesRuleProductRssFeed()
public function categoriesRssFeed()
{
$path = self::XML_PATH_RSS_METHODS . '/catalog/category';
if ((bool)Mage::getStoreConfig($path)) {
if (Mage::getStoreConfigFlag($path)) {
$category = Mage::getModel('catalog/category');

/** @var Varien_Data_Tree_Node $treeModel */
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Shipping/Block/Tracking/Popup.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public function formatDeliveryTime($time, $date = null)
*/
public function getContactUsEnabled()
{
return (bool) Mage::getStoreConfig('contacts/contacts/enabled');
return Mage::getStoreConfigFlag('contacts/contacts/enabled');
}

/**
Expand Down