Skip to content

Commit

Permalink
Merge branch 'github/main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
nquam-ac committed Jan 10, 2022
2 parents 2098dd3 + 5f3135f commit aa8fbd8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Core/Controller/Adminhtml/System/Config/Connect.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ public function __construct(
public function execute()
{
$request = $this->getRequest()->getParams();

// Set store to default if Single store mode
$request['store'] = $request['store'] ?? $this->storeManager->getDefaultStoreView()->getId();

$return = [];

if ($request['status'] && !empty($request['api_url']) && !empty($request['api_key'])) {
Expand Down
13 changes: 13 additions & 0 deletions Core/Controller/Adminhtml/System/Config/Disconnect.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Magento\PageCache\Model\Cache\Type;
use Magento\Store\Api\StoreRepositoryInterface;
use Magento\Store\Model\ScopeInterface;
use Magento\Store\Model\StoreManagerInterface;

class Disconnect extends Action
{
Expand Down Expand Up @@ -56,13 +57,19 @@ class Disconnect extends Action
*/
private $curl;

/**
* @var StoreManagerInterface
*/
private $storeManager;

/**
* Connection constructor.
* @param Context $context
* @param JsonFactory $resultJsonFactory
* @param TypeListInterface $cacheTypeList
* @param ConfigInterface $configInterface
* @param StoreRepositoryInterface $storeRepository
* @param StoreManagerInterface $storeManager
* @param ActiveCampaignHelper $activeCampaignHelper
* @param Curl $curl
*/
Expand All @@ -72,6 +79,7 @@ public function __construct(
TypeListInterface $cacheTypeList,
ConfigInterface $configInterface,
StoreRepositoryInterface $storeRepository,
StoreManagerInterface $storeManager,
ActiveCampaignHelper $activeCampaignHelper,
Curl $curl
) {
Expand All @@ -80,6 +88,7 @@ public function __construct(
$this->cacheTypeList = $cacheTypeList;
$this->configInterface = $configInterface;
$this->storeRepository = $storeRepository;
$this->storeManager = $storeManager;
$this->activeCampaignHelper = $activeCampaignHelper;
$this->curl = $curl;
}
Expand All @@ -92,6 +101,10 @@ public function __construct(
public function execute()
{
$request = $this->getRequest()->getParams();

// Set store to default if Single store mode
$request['store'] = $request['store'] ?? $this->storeManager->getDefaultStoreView()->getId();

$return = [];
$return['success'] = false;

Expand Down

0 comments on commit aa8fbd8

Please sign in to comment.