Skip to content

Commit ef61afe

Browse files
committed
Merge remote-tracking branch 'origin/2.3-develop' into GraphQL-538
# Conflicts: # dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php
2 parents 372b03e + 4f6c78e commit ef61afe

File tree

403 files changed

+10535
-2422
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

403 files changed

+10535
-2422
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ cache:
5454
- $HOME/node_modules
5555
- $HOME/yarn.lock
5656
before_install:
57-
- curl -O https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.3.0/elasticsearch-2.3.0.deb && sudo dpkg -i --force-confnew elasticsearch-2.3.0.deb && sudo service elasticsearch restart
5857
- ./dev/travis/before_install.sh
5958
install: composer install --no-interaction
6059
before_script: ./dev/travis/before_script.sh

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ Tests:
489489
* Fixed an issue where found records in global search in Backend could not be selected via keyboard
490490
* Fixed an issue where Category menu items went out of screen when page side was reached
491491
* Fixed an issue where subcategories in menu were shown instantly when user moved mouse quickly
492-
* Fixed an issue where popup header was our of window range while creating group product
492+
* Fixed an issue where popup header was out of window range while creating group product
493493
* Fixed an issue where region field was absent in customer address form on backend for "United Kingdom" country
494494
* Fixed an ability to edit the Order from Admin panel
495495
* Fixed an issue where email could not be retrieved from \Magento\Quote\Api\Data\AddressInterface after adding an address on OnePageCheckout
@@ -626,7 +626,7 @@ Tests:
626626
* Fixed an issue where filters were not shown on product reviews report grid
627627
* Fixed an issue where second customer address was not deleted from customer account
628628
* Fixed an issue where custom options pop-up was still displayed after submit
629-
* Fixed an issue where Second Product was not added to Shopping Cart from Wishlist at first atempt
629+
* Fixed an issue where Second Product was not added to Shopping Cart from Wishlist at first attempt
630630
* Fixed an issue where customer invalid email message was not displayed
631631
* Fixed an issue where All Access Tokens for Customer without Tokens could not be revoked
632632
* Fixed an issue where it was impossible to add Product to Shopping Cart from shared Wishlist

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<h2>Welcome</h2>
66
Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting-edge, feature-rich eCommerce solution that gets results.
77

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

1111
## Install Magento
1212

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

15-
<h2>Contributing to the Magento 2 code base</h2>
15+
<h2>Contributing to the Magento 2 Code Base</h2>
1616
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.
1717

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

42-
### Labels applied by the Magento team
42+
### Labels Applied by the Magento Team
4343
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.
4444
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.
4545

46-
## Reporting security issues
46+
## Reporting Security Issues
4747

4848
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).
4949

app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract
185185
* @param AdvancedPricing\Validator\Website $websiteValidator
186186
* @param AdvancedPricing\Validator\TierPrice $tierPriceValidator
187187
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
188+
* @throws \Exception
188189
*/
189190
public function __construct(
190191
\Magento\Framework\Json\Helper\Data $jsonHelper,
@@ -255,6 +256,7 @@ public function getEntityTypeCode()
255256
* @param array $rowData
256257
* @param int $rowNum
257258
* @return bool
259+
* @throws \Zend_Validate_Exception
258260
*/
259261
public function validateRow(array $rowData, $rowNum)
260262
{
@@ -308,6 +310,7 @@ protected function _importData()
308310
* Save advanced pricing
309311
*
310312
* @return $this
313+
* @throws \Exception
311314
*/
312315
public function saveAdvancedPricing()
313316
{
@@ -319,6 +322,7 @@ public function saveAdvancedPricing()
319322
* Deletes Advanced price data from raw data.
320323
*
321324
* @return $this
325+
* @throws \Exception
322326
*/
323327
public function deleteAdvancedPricing()
324328
{
@@ -347,6 +351,7 @@ public function deleteAdvancedPricing()
347351
* Replace advanced pricing
348352
*
349353
* @return $this
354+
* @throws \Exception
350355
*/
351356
public function replaceAdvancedPricing()
352357
{
@@ -360,6 +365,7 @@ public function replaceAdvancedPricing()
360365
* @return $this
361366
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
362367
* @SuppressWarnings(PHPMD.NPathComplexity)
368+
* @throws \Exception
363369
*/
364370
protected function saveAndReplaceAdvancedPrices()
365371
{
@@ -368,8 +374,8 @@ protected function saveAndReplaceAdvancedPrices()
368374
$this->_cachedSkuToDelete = null;
369375
}
370376
$listSku = [];
377+
$tierPrices = [];
371378
while ($bunch = $this->_dataSourceModel->getNextBunch()) {
372-
$tierPrices = [];
373379
foreach ($bunch as $rowNum => $rowData) {
374380
if (!$this->validateRow($rowData, $rowNum)) {
375381
$this->addRowError(ValidatorInterface::ERROR_SKU_IS_EMPTY, $rowNum);
@@ -397,15 +403,8 @@ protected function saveAndReplaceAdvancedPrices()
397403
];
398404
}
399405
}
400-
if (\Magento\ImportExport\Model\Import::BEHAVIOR_REPLACE == $behavior) {
401-
if ($listSku) {
402-
$this->processCountNewPrices($tierPrices);
403-
if ($this->deleteProductTierPrices(array_unique($listSku), self::TABLE_TIER_PRICE)) {
404-
$this->saveProductPrices($tierPrices, self::TABLE_TIER_PRICE);
405-
$this->setUpdatedAt($listSku);
406-
}
407-
}
408-
} elseif (\Magento\ImportExport\Model\Import::BEHAVIOR_APPEND == $behavior) {
406+
407+
if (\Magento\ImportExport\Model\Import::BEHAVIOR_APPEND == $behavior) {
409408
$this->processCountExistingPrices($tierPrices, self::TABLE_TIER_PRICE)
410409
->processCountNewPrices($tierPrices);
411410

@@ -415,6 +414,17 @@ protected function saveAndReplaceAdvancedPrices()
415414
}
416415
}
417416
}
417+
418+
if (\Magento\ImportExport\Model\Import::BEHAVIOR_REPLACE == $behavior) {
419+
if ($listSku) {
420+
$this->processCountNewPrices($tierPrices);
421+
if ($this->deleteProductTierPrices(array_unique($listSku), self::TABLE_TIER_PRICE)) {
422+
$this->saveProductPrices($tierPrices, self::TABLE_TIER_PRICE);
423+
$this->setUpdatedAt($listSku);
424+
}
425+
}
426+
}
427+
418428
return $this;
419429
}
420430

@@ -424,6 +434,7 @@ protected function saveAndReplaceAdvancedPrices()
424434
* @param array $priceData
425435
* @param string $table
426436
* @return $this
437+
* @throws \Exception
427438
*/
428439
protected function saveProductPrices(array $priceData, $table)
429440
{
@@ -455,6 +466,7 @@ protected function saveProductPrices(array $priceData, $table)
455466
* @param array $listSku
456467
* @param string $table
457468
* @return boolean
469+
* @throws \Exception
458470
*/
459471
protected function deleteProductTierPrices(array $listSku, $table)
460472
{
@@ -532,6 +544,7 @@ protected function getCustomerGroupId($customerGroup)
532544
* Retrieve product skus
533545
*
534546
* @return array
547+
* @throws \Exception
535548
*/
536549
protected function retrieveOldSkus()
537550
{
@@ -552,6 +565,7 @@ protected function retrieveOldSkus()
552565
* @param array $prices
553566
* @param string $table
554567
* @return $this
568+
* @throws \Exception
555569
*/
556570
protected function processCountExistingPrices($prices, $table)
557571
{

app/code/Magento/AsynchronousOperations/Model/MassConsumer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Magento\Framework\MessageQueue\MessageLockException;
1515
use Magento\Framework\MessageQueue\ConnectionLostException;
1616
use Magento\Framework\Exception\NotFoundException;
17-
use Magento\Framework\MessageQueue\CallbackInvoker;
17+
use Magento\Framework\MessageQueue\CallbackInvokerInterface;
1818
use Magento\Framework\MessageQueue\ConsumerConfigurationInterface;
1919
use Magento\Framework\MessageQueue\EnvelopeInterface;
2020
use Magento\Framework\MessageQueue\QueueInterface;
@@ -30,7 +30,7 @@
3030
class MassConsumer implements ConsumerInterface
3131
{
3232
/**
33-
* @var \Magento\Framework\MessageQueue\CallbackInvoker
33+
* @var CallbackInvokerInterface
3434
*/
3535
private $invoker;
3636

@@ -67,7 +67,7 @@ class MassConsumer implements ConsumerInterface
6767
/**
6868
* Initialize dependencies.
6969
*
70-
* @param CallbackInvoker $invoker
70+
* @param CallbackInvokerInterface $invoker
7171
* @param ResourceConnection $resource
7272
* @param MessageController $messageController
7373
* @param ConsumerConfigurationInterface $configuration
@@ -76,7 +76,7 @@ class MassConsumer implements ConsumerInterface
7676
* @param Registry $registry
7777
*/
7878
public function __construct(
79-
CallbackInvoker $invoker,
79+
CallbackInvokerInterface $invoker,
8080
ResourceConnection $resource,
8181
MessageController $messageController,
8282
ConsumerConfigurationInterface $configuration,

app/code/Magento/AsynchronousOperations/Model/MassSchedule.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Psr\Log\LoggerInterface;
2121
use Magento\AsynchronousOperations\Model\ResourceModel\Operation\OperationRepository;
2222
use Magento\Authorization\Model\UserContextInterface;
23+
use Magento\Framework\Encryption\Encryptor;
2324

2425
/**
2526
* Class MassSchedule used for adding multiple entities as Operations to Bulk Management with the status tracking
@@ -63,6 +64,11 @@ class MassSchedule
6364
*/
6465
private $userContext;
6566

67+
/**
68+
* @var Encryptor
69+
*/
70+
private $encryptor;
71+
6672
/**
6773
* Initialize dependencies.
6874
*
@@ -73,6 +79,7 @@ class MassSchedule
7379
* @param LoggerInterface $logger
7480
* @param OperationRepository $operationRepository
7581
* @param UserContextInterface $userContext
82+
* @param Encryptor|null $encryptor
7683
*/
7784
public function __construct(
7885
IdentityGeneratorInterface $identityService,
@@ -81,7 +88,8 @@ public function __construct(
8188
BulkManagementInterface $bulkManagement,
8289
LoggerInterface $logger,
8390
OperationRepository $operationRepository,
84-
UserContextInterface $userContext = null
91+
UserContextInterface $userContext = null,
92+
Encryptor $encryptor = null
8593
) {
8694
$this->identityService = $identityService;
8795
$this->itemStatusInterfaceFactory = $itemStatusInterfaceFactory;
@@ -90,6 +98,7 @@ public function __construct(
9098
$this->logger = $logger;
9199
$this->operationRepository = $operationRepository;
92100
$this->userContext = $userContext ?: ObjectManager::getInstance()->get(UserContextInterface::class);
101+
$this->encryptor = $encryptor ?: ObjectManager::getInstance()->get(Encryptor::class);
93102
}
94103

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

132141
try {
133-
$operations[] = $this->operationRepository->createByTopic($topicName, $entityParams, $groupId);
142+
$operation = $this->operationRepository->createByTopic($topicName, $entityParams, $groupId);
143+
$operations[] = $operation;
134144
$requestItem->setId($key);
135145
$requestItem->setStatus(ItemStatusInterface::STATUS_ACCEPTED);
146+
$requestItem->setDataHash(
147+
$this->encryptor->hash($operation->getSerializedData(), Encryptor::HASH_VERSION_SHA256)
148+
);
136149
$requestItems[] = $requestItem;
137150
} catch (\Exception $exception) {
138151
$this->logger->error($exception);

app/code/Magento/Authorizenet/Model/Directpost.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -546,15 +546,16 @@ public function setResponseData(array $postData)
546546
public function validateResponse()
547547
{
548548
$response = $this->getResponse();
549-
//md5 check
550-
if (!$this->getConfigData('trans_md5')
551-
|| !$this->getConfigData('login')
552-
|| !$response->isValidHash($this->getConfigData('trans_md5'), $this->getConfigData('login'))
549+
$hashConfigKey = !empty($response->getData('x_SHA2_Hash')) ? 'signature_key' : 'trans_md5';
550+
551+
//hash check
552+
if (!$response->isValidHash($this->getConfigData($hashConfigKey), $this->getConfigData('login'))
553553
) {
554554
throw new \Magento\Framework\Exception\LocalizedException(
555555
__('The transaction was declined because the response hash validation failed.')
556556
);
557557
}
558+
558559
return true;
559560
}
560561

0 commit comments

Comments
 (0)