Skip to content

Commit

Permalink
Merge pull request #1 from magento/2.3-develop
Browse files Browse the repository at this point in the history
merge latest M2
  • Loading branch information
stkec authored Mar 26, 2019
2 parents dc3bdb8 + 0d881fc commit b34eb7a
Show file tree
Hide file tree
Showing 338 changed files with 9,657 additions and 2,177 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ Tests:
* Fixed an issue where filters were not shown on product reviews report grid
* Fixed an issue where second customer address was not deleted from customer account
* Fixed an issue where custom options pop-up was still displayed after submit
* Fixed an issue where Second Product was not added to Shopping Cart from Wishlist at first atempt
* Fixed an issue where Second Product was not added to Shopping Cart from Wishlist at first attempt
* Fixed an issue where customer invalid email message was not displayed
* Fixed an issue where All Access Tokens for Customer without Tokens could not be revoked
* Fixed an issue where it was impossible to add Product to Shopping Cart from shared Wishlist
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<h2>Welcome</h2>
Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting-edge, feature-rich eCommerce solution that gets results.

## Magento system requirements
[Magento system requirements](https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements2.html).
## Magento System Requirements
[Magento System Requirements](https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements2.html).

## Install Magento

* [Installation guide](https://devdocs.magento.com/guides/v2.3/install-gde/bk-install-guide.html).
* [Installation Guide](https://devdocs.magento.com/guides/v2.3/install-gde/bk-install-guide.html).

<h2>Contributing to the Magento 2 code base</h2>
<h2>Contributing to the Magento 2 Code Base</h2>
Contributions can take the form of new components or features, changes to existing features, tests, documentation (such as developer guides, user guides, examples, or specifications), bug fixes, optimizations, or just good suggestions.

To learn about how to make a contribution, click [here][1].
Expand All @@ -39,11 +39,11 @@ Magento is thankful for any contribution that can improve our code base, documen
<img src="https://raw.githubusercontent.com/wiki/magento/magento2/images/contributors.png"/>
</a>

### Labels applied by the Magento team
### Labels Applied by the Magento Team
We apply labels to public Pull Requests and Issues to help other participants retrieve additional information about current progress, component assignments, Magento release lines, and much more.
Please review the [Code Contributions guide](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#labels) for detailed information on labels used in Magento 2 repositories.

## Reporting security issues
## Reporting Security Issues

To report security vulnerabilities in Magento software or web sites, please create a Bugcrowd researcher account [there](https://bugcrowd.com/magento) to submit and follow-up your issue. Learn more about reporting security issues [here](https://magento.com/security/reporting-magento-security-issue).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract
* @param AdvancedPricing\Validator\Website $websiteValidator
* @param AdvancedPricing\Validator\TierPrice $tierPriceValidator
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
* @throws \Exception
*/
public function __construct(
\Magento\Framework\Json\Helper\Data $jsonHelper,
Expand Down Expand Up @@ -255,6 +256,7 @@ public function getEntityTypeCode()
* @param array $rowData
* @param int $rowNum
* @return bool
* @throws \Zend_Validate_Exception
*/
public function validateRow(array $rowData, $rowNum)
{
Expand Down Expand Up @@ -308,6 +310,7 @@ protected function _importData()
* Save advanced pricing
*
* @return $this
* @throws \Exception
*/
public function saveAdvancedPricing()
{
Expand All @@ -319,6 +322,7 @@ public function saveAdvancedPricing()
* Deletes Advanced price data from raw data.
*
* @return $this
* @throws \Exception
*/
public function deleteAdvancedPricing()
{
Expand Down Expand Up @@ -347,6 +351,7 @@ public function deleteAdvancedPricing()
* Replace advanced pricing
*
* @return $this
* @throws \Exception
*/
public function replaceAdvancedPricing()
{
Expand All @@ -360,6 +365,7 @@ public function replaceAdvancedPricing()
* @return $this
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.NPathComplexity)
* @throws \Exception
*/
protected function saveAndReplaceAdvancedPrices()
{
Expand All @@ -368,8 +374,8 @@ protected function saveAndReplaceAdvancedPrices()
$this->_cachedSkuToDelete = null;
}
$listSku = [];
$tierPrices = [];
while ($bunch = $this->_dataSourceModel->getNextBunch()) {
$tierPrices = [];
foreach ($bunch as $rowNum => $rowData) {
if (!$this->validateRow($rowData, $rowNum)) {
$this->addRowError(ValidatorInterface::ERROR_SKU_IS_EMPTY, $rowNum);
Expand Down Expand Up @@ -397,15 +403,8 @@ protected function saveAndReplaceAdvancedPrices()
];
}
}
if (\Magento\ImportExport\Model\Import::BEHAVIOR_REPLACE == $behavior) {
if ($listSku) {
$this->processCountNewPrices($tierPrices);
if ($this->deleteProductTierPrices(array_unique($listSku), self::TABLE_TIER_PRICE)) {
$this->saveProductPrices($tierPrices, self::TABLE_TIER_PRICE);
$this->setUpdatedAt($listSku);
}
}
} elseif (\Magento\ImportExport\Model\Import::BEHAVIOR_APPEND == $behavior) {

if (\Magento\ImportExport\Model\Import::BEHAVIOR_APPEND == $behavior) {
$this->processCountExistingPrices($tierPrices, self::TABLE_TIER_PRICE)
->processCountNewPrices($tierPrices);

Expand All @@ -415,6 +414,17 @@ protected function saveAndReplaceAdvancedPrices()
}
}
}

if (\Magento\ImportExport\Model\Import::BEHAVIOR_REPLACE == $behavior) {
if ($listSku) {
$this->processCountNewPrices($tierPrices);
if ($this->deleteProductTierPrices(array_unique($listSku), self::TABLE_TIER_PRICE)) {
$this->saveProductPrices($tierPrices, self::TABLE_TIER_PRICE);
$this->setUpdatedAt($listSku);
}
}
}

return $this;
}

Expand All @@ -424,6 +434,7 @@ protected function saveAndReplaceAdvancedPrices()
* @param array $priceData
* @param string $table
* @return $this
* @throws \Exception
*/
protected function saveProductPrices(array $priceData, $table)
{
Expand Down Expand Up @@ -455,6 +466,7 @@ protected function saveProductPrices(array $priceData, $table)
* @param array $listSku
* @param string $table
* @return boolean
* @throws \Exception
*/
protected function deleteProductTierPrices(array $listSku, $table)
{
Expand Down Expand Up @@ -532,6 +544,7 @@ protected function getCustomerGroupId($customerGroup)
* Retrieve product skus
*
* @return array
* @throws \Exception
*/
protected function retrieveOldSkus()
{
Expand All @@ -552,6 +565,7 @@ protected function retrieveOldSkus()
* @param array $prices
* @param string $table
* @return $this
* @throws \Exception
*/
protected function processCountExistingPrices($prices, $table)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Magento\Framework\MessageQueue\MessageLockException;
use Magento\Framework\MessageQueue\ConnectionLostException;
use Magento\Framework\Exception\NotFoundException;
use Magento\Framework\MessageQueue\CallbackInvoker;
use Magento\Framework\MessageQueue\CallbackInvokerInterface;
use Magento\Framework\MessageQueue\ConsumerConfigurationInterface;
use Magento\Framework\MessageQueue\EnvelopeInterface;
use Magento\Framework\MessageQueue\QueueInterface;
Expand All @@ -30,7 +30,7 @@
class MassConsumer implements ConsumerInterface
{
/**
* @var \Magento\Framework\MessageQueue\CallbackInvoker
* @var CallbackInvokerInterface
*/
private $invoker;

Expand Down Expand Up @@ -67,7 +67,7 @@ class MassConsumer implements ConsumerInterface
/**
* Initialize dependencies.
*
* @param CallbackInvoker $invoker
* @param CallbackInvokerInterface $invoker
* @param ResourceConnection $resource
* @param MessageController $messageController
* @param ConsumerConfigurationInterface $configuration
Expand All @@ -76,7 +76,7 @@ class MassConsumer implements ConsumerInterface
* @param Registry $registry
*/
public function __construct(
CallbackInvoker $invoker,
CallbackInvokerInterface $invoker,
ResourceConnection $resource,
MessageController $messageController,
ConsumerConfigurationInterface $configuration,
Expand Down
17 changes: 15 additions & 2 deletions app/code/Magento/AsynchronousOperations/Model/MassSchedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Psr\Log\LoggerInterface;
use Magento\AsynchronousOperations\Model\ResourceModel\Operation\OperationRepository;
use Magento\Authorization\Model\UserContextInterface;
use Magento\Framework\Encryption\Encryptor;

/**
* Class MassSchedule used for adding multiple entities as Operations to Bulk Management with the status tracking
Expand Down Expand Up @@ -63,6 +64,11 @@ class MassSchedule
*/
private $userContext;

/**
* @var Encryptor
*/
private $encryptor;

/**
* Initialize dependencies.
*
Expand All @@ -73,6 +79,7 @@ class MassSchedule
* @param LoggerInterface $logger
* @param OperationRepository $operationRepository
* @param UserContextInterface $userContext
* @param Encryptor|null $encryptor
*/
public function __construct(
IdentityGeneratorInterface $identityService,
Expand All @@ -81,7 +88,8 @@ public function __construct(
BulkManagementInterface $bulkManagement,
LoggerInterface $logger,
OperationRepository $operationRepository,
UserContextInterface $userContext = null
UserContextInterface $userContext = null,
Encryptor $encryptor = null
) {
$this->identityService = $identityService;
$this->itemStatusInterfaceFactory = $itemStatusInterfaceFactory;
Expand All @@ -90,6 +98,7 @@ public function __construct(
$this->logger = $logger;
$this->operationRepository = $operationRepository;
$this->userContext = $userContext ?: ObjectManager::getInstance()->get(UserContextInterface::class);
$this->encryptor = $encryptor ?: ObjectManager::getInstance()->get(Encryptor::class);
}

/**
Expand Down Expand Up @@ -130,9 +139,13 @@ public function publishMass($topicName, array $entitiesArray, $groupId = null, $
$requestItem = $this->itemStatusInterfaceFactory->create();

try {
$operations[] = $this->operationRepository->createByTopic($topicName, $entityParams, $groupId);
$operation = $this->operationRepository->createByTopic($topicName, $entityParams, $groupId);
$operations[] = $operation;
$requestItem->setId($key);
$requestItem->setStatus(ItemStatusInterface::STATUS_ACCEPTED);
$requestItem->setDataHash(
$this->encryptor->hash($operation->getSerializedData(), Encryptor::HASH_VERSION_SHA256)
);
$requestItems[] = $requestItem;
} catch (\Exception $exception) {
$this->logger->error($exception);
Expand Down
9 changes: 5 additions & 4 deletions app/code/Magento/Authorizenet/Model/Directpost.php
Original file line number Diff line number Diff line change
Expand Up @@ -546,15 +546,16 @@ public function setResponseData(array $postData)
public function validateResponse()
{
$response = $this->getResponse();
//md5 check
if (!$this->getConfigData('trans_md5')
|| !$this->getConfigData('login')
|| !$response->isValidHash($this->getConfigData('trans_md5'), $this->getConfigData('login'))
$hashConfigKey = !empty($response->getData('x_SHA2_Hash')) ? 'signature_key' : 'trans_md5';

//hash check
if (!$response->isValidHash($this->getConfigData($hashConfigKey), $this->getConfigData('login'))
) {
throw new \Magento\Framework\Exception\LocalizedException(
__('The transaction was declined because the response hash validation failed.')
);
}

return true;
}

Expand Down
Loading

0 comments on commit b34eb7a

Please sign in to comment.