Skip to content

Commit 32c4c46

Browse files
jczhuoMetasol-loup
andauthored
Single store mode fix (#711)
* Only return single store config if it's not null * Fix lint error --------- Co-authored-by: Paul Kang <[email protected]>
1 parent 8b32826 commit 32c4c46

File tree

1 file changed

+12
-5
lines changed
  • app/code/Meta/BusinessExtension/Model/System

1 file changed

+12
-5
lines changed

app/code/Meta/BusinessExtension/Model/System/Config.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -492,12 +492,17 @@ public function isAutoNewsletterSubscriptionOn($scopeId = null, $scope = null):
492492
public function getConfig($configPath, $scopeId = null, $scope = null)
493493
{
494494
if (!$scope && $this->isSingleStoreMode()) {
495-
return $this->scopeConfig->getValue($configPath);
495+
$singleStoreResult = $this->scopeConfig->getValue($configPath);
496+
if ($singleStoreResult !== null) {
497+
return $singleStoreResult;
498+
}
496499
}
497500
try {
498501
$value = $this->scopeConfig->getValue(
499-
$configPath, $scope ?: ScopeInterface::SCOPE_STORE, $scopeId === null
500-
? $this->storeManager->getStore()->getId() : $scopeId
502+
$configPath,
503+
$scope ?: ScopeInterface::SCOPE_STORE,
504+
$scopeId === null
505+
? $this->storeManager->getStore()->getId() : $scopeId
501506
);
502507
} catch (NoSuchEntityException $e) {
503508
return null;
@@ -838,7 +843,8 @@ public function getAllFBEInstalledStores()
838843
{
839844
$stores = $this->storeManager->getStores();
840845
return array_filter(
841-
$stores, function ($store) {
846+
$stores,
847+
function ($store) {
842848
$scopeId = $store->getId();
843849
return $this->isPostOnboardingState($scopeId);
844850
}
@@ -852,7 +858,8 @@ public function getAllOnsiteFBEInstalledStores()
852858
{
853859
$stores = $this->storeManager->getStores();
854860
return array_filter(
855-
$stores, function ($store) {
861+
$stores,
862+
function ($store) {
856863
$scopeId = $store->getId();
857864
return $this->isPostOnboardingState($scopeId) &&
858865
$this->isActiveExtension($scopeId) &&

0 commit comments

Comments
 (0)