Skip to content

Commit 19bfaf5

Browse files
committed
Merge remote-tracking branch 'origin/2.3-develop' into MC-17606
2 parents 24ae0a9 + 70d2287 commit 19bfaf5

File tree

170 files changed

+3617
-756
lines changed

Some content is hidden

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

170 files changed

+3617
-756
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract
5050

5151
const VALIDATOR_WEBSITE = 'validator_website';
5252

53-
const VALIDATOR_TEAR_PRICE = 'validator_tear_price';
53+
/**
54+
* @deprecated
55+
* @see VALIDATOR_TIER_PRICE
56+
*/
57+
private const VALIDATOR_TEAR_PRICE = 'validator_tier_price';
58+
59+
private const VALIDATOR_TIER_PRICE = 'validator_tier_price';
5460

5561
/**
5662
* Validation failure message template definitions.
@@ -221,7 +227,7 @@ public function __construct(
221227
$this->_catalogProductEntity = $this->_resourceFactory->create()->getTable('catalog_product_entity');
222228
$this->_oldSkus = $this->retrieveOldSkus();
223229
$this->_validators[self::VALIDATOR_WEBSITE] = $websiteValidator;
224-
$this->_validators[self::VALIDATOR_TEAR_PRICE] = $tierPriceValidator;
230+
$this->_validators[self::VALIDATOR_TIER_PRICE] = $tierPriceValidator;
225231
$this->errorAggregator = $errorAggregator;
226232

227233
foreach (array_merge($this->errorMessageTemplates, $this->_messageTemplates) as $errorCode => $message) {
@@ -536,7 +542,7 @@ protected function getWebSiteId($websiteCode)
536542
*/
537543
protected function getCustomerGroupId($customerGroup)
538544
{
539-
$customerGroups = $this->_getValidator(self::VALIDATOR_TEAR_PRICE)->getCustomerGroups();
545+
$customerGroups = $this->_getValidator(self::VALIDATOR_TIER_PRICE)->getCustomerGroups();
540546
return $customerGroup == self::VALUE_ALL_GROUPS ? 0 : $customerGroups[$customerGroup];
541547
}
542548

app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
*/
1616
class AdvancedPricingTest extends \Magento\ImportExport\Test\Unit\Model\Import\AbstractImportTestCase
1717
{
18+
/**
19+
* DB Table data
20+
*/
1821
const TABLE_NAME = 'tableName';
1922
const LINK_FIELD = 'linkField';
2023

@@ -54,7 +57,7 @@ class AdvancedPricingTest extends \Magento\ImportExport\Test\Unit\Model\Import\A
5457
protected $websiteValidator;
5558

5659
/**
57-
* @var AdvancedPricing\Validator\TearPrice |\PHPUnit_Framework_MockObject_MockObject
60+
* @var AdvancedPricing\Validator\TierPrice |\PHPUnit_Framework_MockObject_MockObject
5861
*/
5962
protected $tierPriceValidator;
6063

app/code/Magento/AmqpStore/Plugin/Framework/Amqp/Bulk/Exchange.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ public function beforeEnqueue(SubjectExchange $subject, $topic, array $envelopes
9191
if ($headers instanceof AMQPTable) {
9292
try {
9393
$headers->set('store_id', $storeId);
94-
// phpcs:ignore Magento2.Exceptions.ThrowCatch
9594
} catch (AMQPInvalidArgumentException $ea) {
9695
$errorMessage = sprintf("Can't set storeId to amqp message. Error %s.", $ea->getMessage());
9796
$this->logger->error($errorMessage);

app/code/Magento/AuthorizenetGraphQl/Model/AuthorizenetDataProvider.php

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
use Magento\QuoteGraphQl\Model\Cart\Payment\AdditionalDataProviderInterface;
1111
use Magento\Framework\Stdlib\ArrayManager;
12+
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
1213

1314
/**
1415
* SetPaymentMethod additional data provider model for Authorizenet payment method
@@ -36,10 +37,32 @@ public function __construct(
3637
*
3738
* @param array $data
3839
* @return array
40+
* @throws GraphQlInputException
3941
*/
4042
public function getData(array $data): array
4143
{
42-
$additionalData = $this->arrayManager->get(static::PATH_ADDITIONAL_DATA, $data) ?? [];
44+
if (!isset($data[self::PATH_ADDITIONAL_DATA])) {
45+
throw new GraphQlInputException(
46+
__('Required parameter "authorizenet_acceptjs" for "payment_method" is missing.')
47+
);
48+
}
49+
if (!isset($data[self::PATH_ADDITIONAL_DATA]['opaque_data_descriptor'])) {
50+
throw new GraphQlInputException(
51+
__('Required parameter "opaque_data_descriptor" for "authorizenet_acceptjs" is missing.')
52+
);
53+
}
54+
if (!isset($data[self::PATH_ADDITIONAL_DATA]['opaque_data_value'])) {
55+
throw new GraphQlInputException(
56+
__('Required parameter "opaque_data_value" for "authorizenet_acceptjs" is missing.')
57+
);
58+
}
59+
if (!isset($data[self::PATH_ADDITIONAL_DATA]['cc_last_4'])) {
60+
throw new GraphQlInputException(
61+
__('Required parameter "cc_last_4" for "authorizenet_acceptjs" is missing.')
62+
);
63+
}
64+
65+
$additionalData = $this->arrayManager->get(static::PATH_ADDITIONAL_DATA, $data);
4366
foreach ($additionalData as $key => $value) {
4467
$additionalData[$this->convertSnakeCaseToCamelCase($key)] = $value;
4568
unset($additionalData[$key]);

app/code/Magento/Backup/Controller/Adminhtml/Index/Rollback.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ public function execute()
127127
$adminSession->destroy();
128128

129129
$response->setRedirectUrl($this->getUrl('*'));
130-
// phpcs:disable Magento2.Exceptions.ThrowCatch
131130
} catch (\Magento\Framework\Backup\Exception\CantLoadSnapshot $e) {
132131
$errorMsg = __('We can\'t find the backup file.');
133132
} catch (\Magento\Framework\Backup\Exception\FtpConnectionFailed $e) {

app/code/Magento/Bundle/Plugin/UpdatePriceInQuoteItemOptions.php

Lines changed: 0 additions & 55 deletions
This file was deleted.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="BundleProductWithTierPriceInCartTest">
11+
<annotations>
12+
<features value="Bundle"/>
13+
<stories value="Check that price of cart is correct when the bundle product added to the cart twice"/>
14+
<title value="Customer should get the right subtotal in cart when the bundle product added to the cart twice"/>
15+
<description value="Customer should be able to add one more bundle product to the cart and get the right price"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="MC-19727"/>
18+
<group value="bundle"/>
19+
</annotations>
20+
<before>
21+
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
22+
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
23+
<actionGroup ref="LoginAsAdmin" stepKey="login"/>
24+
</before>
25+
<after>
26+
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
27+
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
28+
<actionGroup ref="StorefrontSignOutActionGroup" stepKey="StorefrontSignOutActionGroup"/>
29+
<actionGroup stepKey="deleteBundle" ref="deleteProductUsingProductGrid">
30+
<argument name="product" value="BundleProduct"/>
31+
</actionGroup>
32+
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearFiltersAfter"/>
33+
<actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer">
34+
<argument name="customerEmail" value="CustomerEntityOne.email"/>
35+
</actionGroup>
36+
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="logout"/>
37+
</after>
38+
<amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage"/>
39+
<waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/>
40+
<actionGroup ref="fillMainBundleProductForm" stepKey="fillMainFieldsForBundle"/>
41+
<actionGroup ref="addBundleOptionWithOneProduct" stepKey="addBundleOption1">
42+
<argument name="x" value="0"/>
43+
<argument name="n" value="1"/>
44+
<argument name="prodOneSku" value="$$simpleProduct1.sku$$"/>
45+
<argument name="prodTwoSku" value=""/>
46+
<argument name="optionTitle" value="Option1"/>
47+
<argument name="inputType" value="checkbox"/>
48+
</actionGroup>
49+
<actionGroup ref="addBundleOptionWithOneProduct" stepKey="addBundleOption2">
50+
<argument name="x" value="1"/>
51+
<argument name="n" value="2"/>
52+
<argument name="prodOneSku" value="$$simpleProduct2.sku$$"/>
53+
<argument name="prodTwoSku" value=""/>
54+
<argument name="optionTitle" value="Option2"/>
55+
<argument name="inputType" value="checkbox"/>
56+
</actionGroup>
57+
<scrollToTopOfPage stepKey="scrollTopPageProduct"/>
58+
<actionGroup ref="ProductSetAdvancedPricing" stepKey="addTierPriceProduct">
59+
<argument name="group" value="ALL GROUPS"/>
60+
<argument name="quantity" value="1"/>
61+
<argument name="price" value="Discount"/>
62+
<argument name="amount" value="50"/>
63+
</actionGroup>
64+
<actionGroup ref="SignUpNewUserFromStorefrontActionGroup" stepKey="signUpNewUser">
65+
<argument name="Customer" value="CustomerEntityOne"/>
66+
</actionGroup>
67+
<amOnPage url="{{StorefrontProductPage.url(BundleProduct.urlKey)}}" stepKey="goToStorefront"/>
68+
<waitForPageLoad stepKey="waitForStorefront"/>
69+
<actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickOnCustomizeAndAddToCartButton"/>
70+
<actionGroup ref="StorefrontEnterProductQuantityAndAddToTheCartActionGroup" stepKey="enterProductQuantityAndAddToTheCart">
71+
<argument name="quantity" value="1"/>
72+
</actionGroup>
73+
<actionGroup ref="StorefrontEnterProductQuantityAndAddToTheCartActionGroup" stepKey="enterProductQuantityAndAddToTheCartAgain">
74+
<argument name="quantity" value="1"/>
75+
</actionGroup>
76+
<actionGroup ref="AssertSubTotalOnStorefrontMiniCartActionGroup" stepKey="assertSubTotalOnStorefrontMiniCart">
77+
<argument name="subTotal" value="$246.00"/>
78+
</actionGroup>
79+
</test>
80+
</tests>

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePrice.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ public function __construct(
3939
$this->locator = $locator;
4040
$this->arrayManager = $arrayManager;
4141
}
42-
42+
4343
/**
44-
* {@inheritdoc}
44+
* @inheritdoc
4545
*/
4646
public function modifyMeta(array $meta)
4747
{
@@ -64,7 +64,7 @@ public function modifyMeta(array $meta)
6464
$this->arrayManager->findPath(
6565
ProductAttributeInterface::CODE_PRICE,
6666
$meta,
67-
null,
67+
self::DEFAULT_GENERAL_PANEL . '/children',
6868
'children'
6969
) . static::META_CONFIG_PATH,
7070
$meta,
@@ -94,7 +94,7 @@ public function modifyMeta(array $meta)
9494
}
9595

9696
/**
97-
* {@inheritdoc}
97+
* @inheritdoc
9898
*/
9999
public function modifyData(array $data)
100100
{

app/code/Magento/Bundle/etc/di.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,6 @@
123123
</argument>
124124
</arguments>
125125
</type>
126-
<type name="Magento\Quote\Model\Quote\Item">
127-
<plugin name="update_price_for_bundle_in_quote_item_option" type="Magento\Bundle\Plugin\UpdatePriceInQuoteItemOptions"/>
128-
</type>
129126
<type name="Magento\Quote\Model\Quote\Item\ToOrderItem">
130127
<plugin name="append_bundle_data_to_order" type="Magento\Bundle\Model\Plugin\QuoteItem"/>
131128
</type>

app/code/Magento/Catalog/Block/Product/View/Details.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ public function getGroupSortedChildNames(string $groupName, string $callback): a
3737
$alias = $layout->getElementAlias($childName);
3838
$sortOrder = (int)$this->getChildData($alias, 'sort_order') ?? 0;
3939

40-
$childNamesSortOrder[$sortOrder] = $childName;
40+
$childNamesSortOrder[$childName] = $sortOrder;
4141
}
4242

43-
ksort($childNamesSortOrder, SORT_NUMERIC);
43+
asort($childNamesSortOrder, SORT_NUMERIC);
4444

45-
return $childNamesSortOrder;
45+
return array_keys($childNamesSortOrder);
4646
}
4747
}

0 commit comments

Comments
 (0)