Skip to content

Commit 0e8428c

Browse files
🔃 [EngCom] Public Pull Requests - 2.3-develop Minor Fixes
Accepted Public Pull Requests: - #21785: [Forwardport] [Checkout] Fix clearing admin quote address when removing all items (by @eduard13) - #21469: Update price-bundle.js so that correct tier price is calculated while displaying in bundle product (by @adarshkhatri) - #21751: fix #21750 remove translation of product attribute label (by @Karlasa) - #21774: MSI: Add deprecation message to CatalogInventory SPIs (by @lbajsarowicz) - #21575: Fix for issue #21510: Can't access backend indexers page after creating a custom index (by @ccasciotti) - #21288: #12396: Total Amount cart rule without tax (by @AleksLi) - magento-commerce/magento-functional-tests-migration#679: #417 Removed unnecessary default values in action groups (by @hws47a) - magento-commerce/magento-functional-tests-migration#678: Convert FlushStaticFilesCacheButtonVisibilityTest to MFTF (by @Leandry) - magento-commerce/magento-functional-tests-migration#676: Convert VerifyDisabledCustomerGroupFieldTest to MFTF #664 (by @Michalk39) Fixed GitHub Issues: - #21467: Tier price of simple item not working in Bundle product (reported by @adarshkhatri) has been fixed in #21469 by @adarshkhatri in 2.3-develop branch Related commits: 1. caabef2 2. 4c1c653 3. d4dd2e6 4. e7589ad 5. 6f49b07 6. 0332391 - #21750: Product attribute labels are translated (reported by @Karlasa) has been fixed in #21751 by @Karlasa in 2.3-develop branch Related commits: 1. a07eda3 - #21510: Can't access backend indexers page after creating a custom index (reported by @ccasciotti) has been fixed in #21575 by @ccasciotti in 2.3-develop branch Related commits: 1. 318425f 2. 486e21c 3. 409e00e 4. 0acd6b6 - #12396: "Total Amount" cart rule without tax (reported by @Chei20) has been fixed in #21288 by @AleksLi in 2.3-develop branch Related commits: 1. 6ae859a 2. c25656b 3. 23ed015 4. e9389ee 5. 571f055
2 parents 2e863d6 + 940163e commit 0e8428c

File tree

22 files changed

+178
-18
lines changed

22 files changed

+178
-18
lines changed

app/code/Magento/Bundle/view/base/web/js/price-bundle.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,17 @@ define([
374374
function applyTierPrice(oneItemPrice, qty, optionConfig) {
375375
var tiers = optionConfig.tierPrice,
376376
magicKey = _.keys(oneItemPrice)[0],
377+
tiersFirstKey = _.keys(optionConfig)[0],
377378
lowest = false;
378379

380+
if (!tiers) {//tiers is undefined when options has only one option
381+
tiers = optionConfig[tiersFirstKey].tierPrice;
382+
}
383+
384+
tiers.sort(function (a, b) {//sorting based on "price_qty"
385+
return a['price_qty'] - b['price_qty'];
386+
});
387+
379388
_.each(tiers, function (tier, index) {
380389
if (tier['price_qty'] > qty) {
381390
return;

app/code/Magento/Catalog/view/frontend/templates/product/view/attributes.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
<tbody>
2424
<?php foreach ($_additional as $_data): ?>
2525
<tr>
26-
<th class="col label" scope="row"><?= $block->escapeHtml(__($_data['label'])) ?></th>
27-
<td class="col data" data-th="<?= $block->escapeHtml(__($_data['label'])) ?>"><?= /* @escapeNotVerified */ $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
26+
<th class="col label" scope="row"><?= $block->escapeHtml($_data['label']) ?></th>
27+
<td class="col data" data-th="<?= $block->escapeHtml($_data['label']) ?>"><?= /* @escapeNotVerified */ $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
2828
</tr>
2929
<?php endforeach; ?>
3030
</tbody>

app/code/Magento/CatalogInventory/Model/Spi/StockRegistryProviderInterface.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,33 @@
77

88
/**
99
* Interface StockRegistryProviderInterface
10+
*
11+
* @deprecated 2.3.0 Replaced with Multi Source Inventory
12+
* @link https://devdocs.magento.com/guides/v2.3/inventory/index.html
13+
* @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html
1014
*/
1115
interface StockRegistryProviderInterface
1216
{
1317
/**
18+
* Get stock.
19+
*
1420
* @param int $scopeId
1521
* @return \Magento\CatalogInventory\Api\Data\StockInterface
1622
*/
1723
public function getStock($scopeId);
1824

1925
/**
26+
* Get stock item.
27+
*
2028
* @param int $productId
2129
* @param int $scopeId
2230
* @return \Magento\CatalogInventory\Api\Data\StockItemInterface
2331
*/
2432
public function getStockItem($productId, $scopeId);
2533

2634
/**
35+
* Get stock status.
36+
*
2737
* @param int $productId
2838
* @param int $scopeId
2939
* @return \Magento\CatalogInventory\Api\Data\StockStatusInterface

app/code/Magento/CatalogInventory/Model/Spi/StockStateProviderInterface.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,32 @@
99

1010
/**
1111
* Interface StockStateProviderInterface
12+
*
13+
* @deprecated 2.3.0 Replaced with Multi Source Inventory
14+
* @link https://devdocs.magento.com/guides/v2.3/inventory/index.html
15+
* @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html
1216
*/
1317
interface StockStateProviderInterface
1418
{
1519
/**
20+
* Verify stock.
21+
*
1622
* @param StockItemInterface $stockItem
1723
* @return bool
1824
*/
1925
public function verifyStock(StockItemInterface $stockItem);
2026

2127
/**
28+
* Verify notification.
29+
*
2230
* @param StockItemInterface $stockItem
2331
* @return bool
2432
*/
2533
public function verifyNotification(StockItemInterface $stockItem);
2634

2735
/**
36+
* Validate quote qty.
37+
*
2838
* @param StockItemInterface $stockItem
2939
* @param int|float $itemQty
3040
* @param int|float $qtyToCheck
@@ -44,8 +54,9 @@ public function checkQuoteItemQty(StockItemInterface $stockItem, $itemQty, $qtyT
4454
public function checkQty(StockItemInterface $stockItem, $qty);
4555

4656
/**
47-
* Returns suggested qty that satisfies qty increments and minQty/maxQty/minSaleQty/maxSaleQty conditions
48-
* or original qty if such value does not exist
57+
* Returns suggested qty or original qty if such value does not exist.
58+
*
59+
* Suggested qty satisfies qty increments and minQty/maxQty/minSaleQty/maxSaleQty conditions.
4960
*
5061
* @param StockItemInterface $stockItem
5162
* @param int|float $qty
@@ -54,6 +65,8 @@ public function checkQty(StockItemInterface $stockItem, $qty);
5465
public function suggestQty(StockItemInterface $stockItem, $qty);
5566

5667
/**
68+
* Check qty increments.
69+
*
5770
* @param StockItemInterface $stockItem
5871
* @param int|float $qty
5972
* @return \Magento\Framework\DataObject

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,4 @@
4949
</argument>
5050
</arguments>
5151
</type>
52-
<type name="Magento\Quote\Model\Quote">
53-
<plugin name="clear_addresses_after_product_delete" type="Magento\Checkout\Plugin\Model\Quote\ResetQuoteAddresses"/>
54-
</type>
5552
</config>

app/code/Magento/Checkout/etc/frontend/di.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,7 @@
9696
</argument>
9797
</arguments>
9898
</type>
99+
<type name="Magento\Quote\Model\Quote">
100+
<plugin name="clear_addresses_after_product_delete" type="Magento\Checkout\Plugin\Model\Quote\ResetQuoteAddresses"/>
101+
</type>
99102
</config>

app/code/Magento/Customer/Test/Mftf/Data/CustomerGroupData.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88

99
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="NotLoggedInCustomerGroup" type="customerGroup">
12+
<data key="id">0</data>
13+
<data key="code">NOT LOGGED IN</data>
14+
<data key="tax_class_id">3</data>
15+
<data key="tax_class_name">Retail Customer</data>
16+
</entity>
1117
<entity name="GeneralCustomerGroup" type="customerGroup">
1218
<data key="code">General</data>
1319
<data key="tax_class_id">3</data>

app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGroupMainSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
<element name="selectFirstRow" type="button" selector="//button[@class='action-select']"/>
1616
<element name="deleteBtn" type="button" selector="//*[text()='Delete']"/>
1717
<element name="clearAllBtn" type="button" selector="//button[text()='Clear all']"/>
18+
<element name="editButtonByCustomerGroupCode" type="button" selector="//tr[.//td[count(//th[./*[.='Group']]/preceding-sibling::th) + 1][./*[.='{{code}}']]]//a[contains(@href, '/edit/')]" parameterized="true" />
1819
</section>
1920
</sections>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="VerifyDisabledCustomerGroupFieldTest">
12+
<annotations>
13+
<stories value="Check that field is disabled in system Customer Group"/>
14+
<title value="Check that field is disabled in system Customer Group"/>
15+
<description value="Checks that customer_group_code field is disabled in NOT LOGGED IN Customer Group"/>
16+
<testCaseId value="MC-14206"/>
17+
<severity value="CRITICAL"/>
18+
<group value="customers"/>
19+
<group value="mtf_migrated"/>
20+
</annotations>
21+
22+
<!-- Steps -->
23+
<!-- 1. Login to backend as admin user -->
24+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
25+
<waitForPageLoad stepKey="waitForAdminPageLoad" />
26+
27+
<!-- 2. Navigate to Customers > Customer Groups -->
28+
<amOnPage url="{{AdminCustomerGroupPage.url}}" stepKey="amOnCustomerGroupPage" />
29+
<waitForPageLoad stepKey="waitForCustomerGroupsPageLoad" />
30+
31+
<!-- 3. Select system Customer Group specified in data set from grid -->
32+
<click selector="{{AdminCustomerGroupMainSection.editButtonByCustomerGroupCode(NotLoggedInCustomerGroup.code)}}" stepKey="clickOnEditCustomerGroup" />
33+
34+
<!-- 4. Perform all assertions -->
35+
<seeInField selector="{{AdminNewCustomerGroupSection.groupName}}" userInput="{{NotLoggedInCustomerGroup.code}}" stepKey="seeNotLoggedInTextInGroupName" />
36+
<assertElementContainsAttribute selector="{{AdminNewCustomerGroupSection.groupName}}" attribute="disabled" expectedValue="true" stepKey="checkIfGroupNameIsDisabled" />
37+
</test>
38+
</tests>

app/code/Magento/Indexer/Model/Indexer.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Indexer\Model;
78

89
use Magento\Framework\Indexer\ActionFactory;
@@ -14,6 +15,8 @@
1415
use Magento\Framework\Indexer\StructureFactory;
1516

1617
/**
18+
* Indexer model.
19+
*
1720
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1821
*/
1922
class Indexer extends \Magento\Framework\DataObject implements IndexerInterface
@@ -361,7 +364,7 @@ public function getLatestUpdated()
361364
return $this->getView()->getUpdated();
362365
}
363366
}
364-
return $this->getState()->getUpdated();
367+
return $this->getState()->getUpdated() ?: '';
365368
}
366369

367370
/**

app/code/Magento/Indexer/Test/Unit/Model/IndexerTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,12 @@ public function testGetLatestUpdated($getViewIsEnabled, $getViewGetUpdated, $get
164164
}
165165
}
166166
} else {
167-
$this->assertEquals($getStateGetUpdated, $this->model->getLatestUpdated());
167+
$getLatestUpdated = $this->model->getLatestUpdated();
168+
$this->assertEquals($getStateGetUpdated, $getLatestUpdated);
169+
170+
if ($getStateGetUpdated === null) {
171+
$this->assertNotNull($getLatestUpdated);
172+
}
168173
}
169174
}
170175

@@ -182,7 +187,8 @@ public function getLatestUpdatedDataProvider()
182187
[true, '', '06-Jan-1944'],
183188
[true, '06-Jan-1944', ''],
184189
[true, '', ''],
185-
[true, '06-Jan-1944', '05-Jan-1944']
190+
[true, '06-Jan-1944', '05-Jan-1944'],
191+
[false, null, null],
186192
];
187193
}
188194

app/code/Magento/PageCache/Test/Mftf/Section/AdminCacheManagementSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@
3030
<element name="pageCacheCheckbox" type="checkbox" selector="input[value='full_page']"/>
3131
<element name="webServicesConfigCheckbox" type="checkbox" selector="input[value='config_webservice']"/>
3232
<element name="translationsCheckbox" type="checkbox" selector="input[value='translate']"/>
33+
<element name="additionalCacheButton" type="button" selector="//*[@id='container']//button[contains(., '{{cacheType}}')]" parameterized="true" />
3334
</section>
3435
</sections>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="FlushStaticFilesCacheButtonVisibilityTest">
12+
<annotations>
13+
<features value="PageCache"/>
14+
<stories value="Page Cache"/>
15+
<title value="Check visibility of flush static files cache button"/>
16+
<description value="Flush Static Files Cache button visibility"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-15454"/>
19+
<group value="production_mode_only"/>
20+
<group value="pagecache"/>
21+
<group value="mtf_migrated"/>
22+
</annotations>
23+
<before>
24+
<!-- Log in to Admin Panel -->
25+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
26+
</before>
27+
28+
<!-- Open Cache Management page -->
29+
<amOnPage url="{{AdminCacheManagementPage.url}}" stepKey="amOnPageCacheManagement"/>
30+
<waitForPageLoad stepKey="waitForPageCacheManagementLoad"/>
31+
32+
<!-- Check 'Flush Static Files Cache' not visible in production mode. -->
33+
<dontSee selector="{{AdminCacheManagementSection.additionalCacheButton('Flush Static Files Cache')}}" stepKey="dontSeeFlushStaticFilesButton" />
34+
</test>
35+
</tests>

app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderStatusFormFillAndSaveActionGroup.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<!-- Fill Order status form and click save -->
1212
<actionGroup name="AdminOrderStatusFormFillAndSave">
1313
<arguments>
14-
<argument name="status" type="string" defaultValue=""/>
15-
<argument name="label" type="string" defaultValue=""/>
14+
<argument name="status" type="string" />
15+
<argument name="label" type="string" />
1616
</arguments>
1717

1818
<fillField stepKey="fillStatusCode" selector="{{AdminOrderStatusFormSection.statusCodeField}}" userInput="{{status}}"/>

app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertOrderStatusExistsInGridActionGroup.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<!-- Search order status grid for item with a specific code and validate data -->
1212
<actionGroup name="AssertOrderStatusExistsInGrid">
1313
<arguments>
14-
<argument name="status" type="string" defaultValue=""/>
15-
<argument name="label" type="string" defaultValue=""/>
14+
<argument name="status" type="string" />
15+
<argument name="label" type="string" />
1616
</arguments>
1717

1818
<click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters"/>

app/code/Magento/SalesRule/Model/Rule/Condition/Address.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public function __construct(
6161
public function loadAttributeOptions()
6262
{
6363
$attributes = [
64+
'base_subtotal_with_discount' => __('Subtotal (Excl. Tax)'),
6465
'base_subtotal' => __('Subtotal'),
6566
'total_qty' => __('Total Items Quantity'),
6667
'weight' => __('Total Weight'),

dev/tests/functional/lib/Magento/Mtf/Client/Element/ConditionsElement.php

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,13 @@ class ConditionsElement extends SimpleElement
195195
*/
196196
protected $exception;
197197

198+
/**
199+
* Condition option text selector.
200+
*
201+
* @var string
202+
*/
203+
private $conditionOptionTextSelector = '//option[normalize-space(text())="%s"]';
204+
198205
/**
199206
* @inheritdoc
200207
*/
@@ -282,10 +289,16 @@ protected function addCondition($type, ElementInterface $context)
282289
$count = 0;
283290

284291
do {
285-
$newCondition->find($this->addNew, Locator::SELECTOR_XPATH)->click();
286-
287292
try {
288-
$newCondition->find($this->typeNew, Locator::SELECTOR_XPATH, 'select')->setValue($type);
293+
$specificType = $newCondition->find(
294+
sprintf($this->conditionOptionTextSelector, $type),
295+
Locator::SELECTOR_XPATH
296+
)->isPresent();
297+
$newCondition->find($this->addNew, Locator::SELECTOR_XPATH)->click();
298+
$condition = $specificType
299+
? $newCondition->find($this->typeNew, Locator::SELECTOR_XPATH, 'selectcondition')
300+
: $newCondition->find($this->typeNew, Locator::SELECTOR_XPATH, 'select');
301+
$condition->setValue($type);
289302
$isSetType = true;
290303
} catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) {
291304
$isSetType = false;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
namespace Magento\Mtf\Client\Element;
10+
11+
/**
12+
* @inheritdoc
13+
*/
14+
class SelectconditionElement extends SelectElement
15+
{
16+
/**
17+
* @inheritdoc
18+
*/
19+
protected $optionByValue = './/option[normalize-space(.)=%s]';
20+
}

dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/VerifyDisabledCustomerGroupFieldTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
99
<testCase name="Magento\Customer\Test\TestCase\VerifyDisabledCustomerGroupFieldTest" summary="Check that field is disabled in system Customer Group" ticketId="MAGETWO-52481">
1010
<variation name="VerifyDisabledCustomerGroupField1" summary="Checks that customer_group_code field is disabled in NOT LOGGED IN Customer Group">
11+
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
1112
<data name="customerGroup/dataset" xsi:type="string">NOT_LOGGED_IN</data>
1213
<data name="disabledFields" xsi:type="array">
1314
<item name="0" xsi:type="string">customer_group_code</item>

dev/tests/functional/tests/app/Magento/PageCache/Test/TestCase/FlushStaticFilesCacheButtonVisibilityTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
99
<testCase name="Magento\PageCache\Test\TestCase\FlushStaticFilesCacheButtonVisibilityTest" summary="Flush Static Files Cache button visibility" ticketId="MAGETWO-39934">
1010
<variation name="FlushStaticFilesCacheButtonVisibilityTest">
11-
<data name="tag" xsi:type="string">severity:S3</data>
11+
<data name="tag" xsi:type="string">severity:S3, mftf_migrated:yes</data>
1212
<constraint name="Magento\PageCache\Test\Constraint\AssertFlushStaticFilesCacheButtonVisibility" />
1313
</variation>
1414
</testCase>

dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/DashboardTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ public function testAjaxBlockAction()
2121

2222
public function testTunnelAction()
2323
{
24+
$this->markTestSkipped('MAGETWO-98800: TunnelAction fails when Google Chart API is not available');
25+
2426
$testUrl = \Magento\Backend\Block\Dashboard\Graph::API_URL . '?cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World';
2527
$handle = curl_init();
2628
curl_setopt($handle, CURLOPT_URL, $testUrl);

0 commit comments

Comments
 (0)