-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '2.4.3-develop' of https://github.com/magento/magento2ce …
…into B2B-1832
- Loading branch information
Showing
34 changed files
with
1,250 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Magento\Config\Model\Config; | ||
|
||
use Magento\Framework\ObjectManager\NoninterceptableInterface; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
class StructureLazy extends Structure implements NoninterceptableInterface | ||
{ | ||
/** | ||
* @var Structure\Data | ||
*/ | ||
private $structureData; | ||
|
||
/** | ||
* @param \Magento\Config\Model\Config\Structure\Data $structureData | ||
* @param \Magento\Config\Model\Config\Structure\Element\Iterator\Tab $tabIterator | ||
* @param \Magento\Config\Model\Config\Structure\Element\FlyweightFactory $flyweightFactory | ||
* @param ScopeDefiner $scopeDefiner | ||
*/ | ||
public function __construct( | ||
\Magento\Config\Model\Config\Structure\Data $structureData, | ||
\Magento\Config\Model\Config\Structure\Element\Iterator\Tab $tabIterator, | ||
\Magento\Config\Model\Config\Structure\Element\FlyweightFactory $flyweightFactory, | ||
ScopeDefiner $scopeDefiner | ||
) { | ||
$this->_tabIterator = $tabIterator; | ||
$this->_flyweightFactory = $flyweightFactory; | ||
$this->_scopeDefiner = $scopeDefiner; | ||
$this->structureData = $structureData; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getElement($path) | ||
{ | ||
$this->loadStructureData(); | ||
return parent::getElement($path); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getTabs() | ||
{ | ||
$this->loadStructureData(); | ||
return parent::getTabs(); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getSectionList() | ||
{ | ||
$this->loadStructureData(); | ||
return parent::getSectionList(); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getElementByConfigPath($path) | ||
{ | ||
$this->loadStructureData(); | ||
return parent::getElementByConfigPath($path); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getFirstSection() | ||
{ | ||
$this->loadStructureData(); | ||
return parent::getTabs(); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getElementByPathParts(array $pathParts) | ||
{ | ||
$this->loadStructureData(); | ||
return parent:: getElementByPathParts($pathParts); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getFieldPathsByAttribute($attributeName, $attributeValue) | ||
{ | ||
$this->loadStructureData(); | ||
return parent::getFieldPathsByAttribute($attributeName, $attributeValue); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getFieldPaths() | ||
{ | ||
$this->loadStructureData(); | ||
return parent::getFieldPaths(); | ||
} | ||
|
||
/** | ||
* Load data | ||
*/ | ||
private function loadStructureData() | ||
{ | ||
if ($this->_data === null) { | ||
$this->_data = $this->structureData->get(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
app/code/Magento/CustomerGraphQl/Plugin/ClearCustomerSessionAfterRequest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\CustomerGraphQl\Plugin; | ||
|
||
use Magento\Authorization\Model\UserContextInterface; | ||
use Magento\Customer\Model\ResourceModel\CustomerRepository; | ||
use Magento\Customer\Model\Session as CustomerSession; | ||
use Magento\Framework\App\ResponseInterface; | ||
use Magento\Framework\Exception\LocalizedException; | ||
use Magento\Framework\Exception\NoSuchEntityException; | ||
use Magento\GraphQl\Controller\GraphQl as GraphQlController; | ||
|
||
/** | ||
* Clear the user data out of the session object before returning the GraphQL response | ||
*/ | ||
class ClearCustomerSessionAfterRequest | ||
{ | ||
/** | ||
* @var UserContextInterface | ||
*/ | ||
private $userContext; | ||
|
||
/** | ||
* @var CustomerSession | ||
*/ | ||
private $customerSession; | ||
|
||
/** | ||
* @var CustomerRepository | ||
*/ | ||
private $customerRepository; | ||
|
||
/** | ||
* @param UserContextInterface $userContext | ||
* @param CustomerSession $customerSession | ||
* @param CustomerRepository $customerRepository | ||
*/ | ||
public function __construct( | ||
UserContextInterface $userContext, | ||
CustomerSession $customerSession, | ||
CustomerRepository $customerRepository | ||
) { | ||
$this->userContext = $userContext; | ||
$this->customerSession = $customerSession; | ||
$this->customerRepository = $customerRepository; | ||
} | ||
|
||
/** | ||
* Clear the customer data from the session after business logic has completed | ||
* | ||
* @param GraphQlController $controller | ||
* @param ResponseInterface $response | ||
* @return ResponseInterface | ||
* | ||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) | ||
*/ | ||
public function afterDispatch(GraphQlController $controller, ResponseInterface $response): ResponseInterface | ||
{ | ||
$this->customerSession->setCustomerId(null); | ||
$this->customerSession->setCustomerGroupId(null); | ||
return $response; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.