Skip to content

Commit 037ff43

Browse files
committed
Merge branch '2.3-develop' of https://github.com/magento/magento2ce into pr
2 parents abd6571 + ae0c3c1 commit 037ff43

File tree

78 files changed

+1720
-233
lines changed

Some content is hidden

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

78 files changed

+1720
-233
lines changed

app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MAGETWO-93677"/>
1919
<group value="braintree"/>
20+
<skip>
21+
<issueId value="MC-13779"/>
22+
</skip>
2023
</annotations>
2124

2225

app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultVideoBundleProductTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<test name="AdminAddDefaultVideoBundleProductTest" extends="AdminAddDefaultVideoSimpleProductTest">
1212
<annotations>
1313
<features value="Bundle"/>

app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultVideoBundleProductTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<test name="AdminRemoveDefaultVideoBundleProductTest" extends="AdminRemoveDefaultVideoSimpleProductTest">
1212
<annotations>
1313
<features value="Bundle"/>

app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleProductTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<test name="AdvanceCatalogSearchBundleByNameTest" extends="AdvanceCatalogSearchSimpleProductByNameTest">
1212
<annotations>
1313
<features value="Bundle"/>

app/code/Magento/BundleGraphQl/Model/Resolver/Options/Collection.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public function __construct(
6161
* Add parent id/sku pair to use for option filter at fetch time.
6262
*
6363
* @param int $parentId
64+
* @param int $parentEntityId
6465
* @param string $sku
6566
*/
6667
public function addParentFilterData(int $parentId, int $parentEntityId, string $sku) : void

app/code/Magento/Captcha/Test/Mftf/Test/CaptchaFormsDisplayingTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<test name="CaptchaFormsDisplayingTest">
1212
<annotations>
1313
<features value="Captcha"/>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,20 @@
4747
<seeElement selector="{{AdminProductMessagesSection.successMessage}}"
4848
stepKey="waitForSuccessMessage"/>
4949
</actionGroup>
50+
<actionGroup name="deleteProductAttributeByLabel">
51+
<arguments>
52+
<argument name="ProductAttribute"/>
53+
</arguments>
54+
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/>
55+
<fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}"
56+
userInput="{{ProductAttribute.default_label}}" stepKey="setAttributeCode"/>
57+
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/>
58+
<click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/>
59+
<waitForPageLoad stepKey="waitForPageLoad"/>
60+
<click selector="{{AttributePropertiesSection.DeleteAttribute}}" stepKey="deleteAttribute"/>
61+
<click selector="{{ModalConfirmationSection.OkButton}}" stepKey="ClickOnDeleteButton"/>
62+
<waitForPageLoad stepKey="waitForPageLoad1"/>
63+
<seeElement selector="{{AdminProductMessagesSection.successMessage}}"
64+
stepKey="waitForSuccessMessage"/>
65+
</actionGroup>
5066
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeOptionsSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
<section name="DropdownAttributeOptionsSection">
1111
<element name="nthOptionAdminLabel" type="input"
1212
selector="(//*[@id='manage-options-panel']//tr[{{var}}]//input[contains(@name, 'option[value]')])[1]" parameterized="true"/>
13+
<element name="deleteButton" type="button" selector="(//td[@class='col-delete'])[1]" timeout="30"/>
1314
</section>
1415
</sections>

app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<test name="AdminAddDefaultVideoSimpleProductTest">
1212
<annotations>
1313
<features value="Catalog"/>

app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoVirtualProductTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<test name="AdminAddDefaultVideoVirtualProductTest" extends="AdminAddDefaultVideoSimpleProductTest">
1212
<annotations>
1313
<features value="Catalog"/>

app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<test name="AdminRemoveDefaultVideoSimpleProductTest">
1212
<annotations>
1313
<features value="Catalog"/>

app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoVirtualProductTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<test name="AdminRemoveDefaultVideoVirtualProductTest" extends="AdminRemoveDefaultVideoSimpleProductTest">
1212
<annotations>
1313
<features value="Catalog"/>

app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchVirtualProductTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<test name="AdvanceCatalogSearchVirtualProductByNameTest" extends="AdvanceCatalogSearchSimpleProductByNameTest">
1212
<annotations>
1313
<features value="Catalog"/>

app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<test name="CheckTierPricingOfProductsTest">
1212
<annotations>
1313
<features value="Shopping Cart"/>

app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MAGETWO-61717"/>
1919
<group value="Catalog"/>
20-
<!-- skip due to MAGETWO-97424 -->
21-
<group value="skip"/>
2220
</annotations>
2321
<before>
2422
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>

app/code/Magento/CatalogGraphQl/Model/Category/LevelCalculator.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@
1515
*/
1616
class LevelCalculator
1717
{
18+
/**
19+
* @var ResourceConnection
20+
*/
21+
private $resourceConnection;
22+
23+
/**
24+
* @var Category
25+
*/
26+
private $resourceCategory;
27+
1828
/**
1929
* @param ResourceConnection $resourceConnection
2030
* @param Category $resourceCategory
@@ -39,6 +49,7 @@ public function calculate(int $rootCategoryId) : int
3949
$select = $connection->select()
4050
->from($this->resourceConnection->getTableName('catalog_category_entity'), 'level')
4151
->where($this->resourceCategory->getLinkField() . " = ?", $rootCategoryId);
52+
4253
return (int) $connection->fetchOne($select);
4354
}
4455
}

app/code/Magento/CatalogWidget/Block/Product/ProductsList.php

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@
66

77
namespace Magento\CatalogWidget\Block\Product;
88

9+
use Magento\Catalog\Model\Product;
910
use Magento\Framework\App\ObjectManager;
11+
use Magento\Framework\App\ActionInterface;
1012
use Magento\Framework\DataObject\IdentityInterface;
1113
use Magento\Framework\Pricing\PriceCurrencyInterface;
1214
use Magento\Framework\Serialize\Serializer\Json;
15+
use Magento\Framework\View\LayoutFactory;
1316
use Magento\Widget\Block\BlockInterface;
1417
use Magento\Framework\Url\EncoderInterface;
1518

@@ -96,11 +99,21 @@ class ProductsList extends \Magento\Catalog\Block\Product\AbstractProduct implem
9699
*/
97100
private $json;
98101

102+
/**
103+
* @var LayoutFactory
104+
*/
105+
private $layoutFactory;
106+
99107
/**
100108
* @var \Magento\Framework\Url\EncoderInterface|null
101109
*/
102110
private $urlEncoder;
103111

112+
/**
113+
* @var \Magento\Framework\View\Element\RendererList
114+
*/
115+
private $rendererListBlock;
116+
104117
/**
105118
* @param \Magento\Catalog\Block\Product\Context $context
106119
* @param \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory
@@ -111,7 +124,10 @@ class ProductsList extends \Magento\Catalog\Block\Product\AbstractProduct implem
111124
* @param \Magento\Widget\Helper\Conditions $conditionsHelper
112125
* @param array $data
113126
* @param Json|null $json
127+
* @param LayoutFactory|null $layoutFactory
114128
* @param \Magento\Framework\Url\EncoderInterface|null $urlEncoder
129+
*
130+
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
115131
*/
116132
public function __construct(
117133
\Magento\Catalog\Block\Product\Context $context,
@@ -123,6 +139,7 @@ public function __construct(
123139
\Magento\Widget\Helper\Conditions $conditionsHelper,
124140
array $data = [],
125141
Json $json = null,
142+
LayoutFactory $layoutFactory = null,
126143
EncoderInterface $urlEncoder = null
127144
) {
128145
$this->productCollectionFactory = $productCollectionFactory;
@@ -132,6 +149,7 @@ public function __construct(
132149
$this->rule = $rule;
133150
$this->conditionsHelper = $conditionsHelper;
134151
$this->json = $json ?: ObjectManager::getInstance()->get(Json::class);
152+
$this->layoutFactory = $layoutFactory ?: ObjectManager::getInstance()->get(LayoutFactory::class);
135153
$this->urlEncoder = $urlEncoder ?: ObjectManager::getInstance()->get(EncoderInterface::class);
136154
parent::__construct(
137155
$context,
@@ -228,6 +246,41 @@ public function getProductPriceHtml(
228246
return $price;
229247
}
230248

249+
/**
250+
* @inheritdoc
251+
*/
252+
protected function getDetailsRendererList()
253+
{
254+
if (empty($this->rendererListBlock)) {
255+
/** @var $layout \Magento\Framework\View\LayoutInterface */
256+
$layout = $this->layoutFactory->create(['cacheable' => false]);
257+
$layout->getUpdate()->addHandle('catalog_widget_product_list')->load();
258+
$layout->generateXml();
259+
$layout->generateElements();
260+
261+
$this->rendererListBlock = $layout->getBlock('category.product.type.widget.details.renderers');
262+
}
263+
return $this->rendererListBlock;
264+
}
265+
266+
/**
267+
* Get post parameters.
268+
*
269+
* @param Product $product
270+
* @return array
271+
*/
272+
public function getAddToCartPostParams(Product $product)
273+
{
274+
$url = $this->getAddToCartUrl($product);
275+
return [
276+
'action' => $url,
277+
'data' => [
278+
'product' => $product->getEntityId(),
279+
ActionInterface::PARAM_NAME_URL_ENCODED => $this->urlEncoder->encode($url),
280+
]
281+
];
282+
}
283+
231284
/**
232285
* @inheritdoc
233286
*/
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!--
2+
~ Copyright © Magento, Inc. All rights reserved.
3+
~ See COPYING.txt for license details.
4+
-->
5+
6+
<!--
7+
~ Copyright © Magento, Inc. All rights reserved.
8+
~ See COPYING.txt for license details.
9+
-->
10+
11+
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
12+
<body>
13+
<block class="Magento\Framework\View\Element\RendererList" name="category.product.type.widget.details.renderers">
14+
<block class="Magento\Framework\View\Element\Template" name="category.product.type.details.renderers.default" as="default"/>
15+
</block>
16+
</body>
17+
</page>

app/code/Magento/CatalogWidget/view/frontend/templates/product/widget/content/grid.phtml

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
use Magento\Framework\App\Action\Action;
67

78
// @codingStandardsIgnoreFile
89

910
/** @var \Magento\CatalogWidget\Block\Product\ProductsList $block */
1011
?>
1112
<?php if ($exist = ($block->getProductCollection() && $block->getProductCollection()->getSize())): ?>
12-
<?php
13+
<?php
1314
$type = 'widget-product-grid';
1415

1516
$mode = 'grid';
@@ -22,12 +23,12 @@
2223
$showCart = true;
2324
$templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;
2425
$description = false;
25-
?>
26+
?>
2627
<div class="block widget block-products-list <?= /* @noEscape */ $mode ?>">
2728
<?php if ($block->getTitle()): ?>
28-
<div class="block-title">
29-
<strong><?= $block->escapeHtml(__($block->getTitle())) ?></strong>
30-
</div>
29+
<div class="block-title">
30+
<strong><?= $block->escapeHtml(__($block->getTitle())) ?></strong>
31+
</div>
3132
<?php endif ?>
3233
<div class="block-content">
3334
<?= /* @noEscape */ '<!-- ' . $image . '-->' ?>
@@ -51,26 +52,28 @@
5152
<?php if ($templateType): ?>
5253
<?= $block->getReviewsSummaryHtml($_item, $templateType) ?>
5354
<?php endif; ?>
54-
<?php echo $block->getProductPriceHtml($_item, $type); ?>
55+
56+
<?= $block->getProductPriceHtml($_item, $type) ?>
57+
58+
<?= $block->getProductDetailsHtml($_item) ?>
59+
5560
<?php if ($showWishlist || $showCompare || $showCart): ?>
5661
<div class="product-item-inner">
5762
<div class="product-item-actions">
5863
<?php if ($showCart): ?>
5964
<div class="actions-primary">
6065
<?php if ($_item->isSaleable()): ?>
61-
<?php if (!$_item->getTypeInstance()->isPossibleBuyFromList($_item)): ?>
62-
<button class="action tocart primary" data-mage-init='{"redirectUrl":{"url":"<?= $block->escapeUrl($block->getAddToCartUrl($_item)) ?>"}}' type="button" title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>">
63-
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
66+
<?php $postParams = $block->getAddToCartPostParams($_item); ?>
67+
<form data-role="tocart-form" data-product-sku="<?= $block->escapeHtml($_item->getSku()) ?>" action="<?= /* @NoEscape */ $postParams['action'] ?>" method="post">
68+
<input type="hidden" name="product" value="<?= /* @escapeNotVerified */ $postParams['data']['product'] ?>">
69+
<input type="hidden" name="<?= /* @escapeNotVerified */ Action::PARAM_NAME_URL_ENCODED ?>" value="<?= /* @escapeNotVerified */ $postParams['data'][Action::PARAM_NAME_URL_ENCODED] ?>">
70+
<?= $block->getBlockHtml('formkey') ?>
71+
<button type="submit"
72+
title="<?= $block->escapeHtml(__('Add to Cart')) ?>"
73+
class="action tocart primary">
74+
<span><?= /* @escapeNotVerified */ __('Add to Cart') ?></span>
6475
</button>
65-
<?php else: ?>
66-
<?php
67-
$postDataHelper = $this->helper('Magento\Framework\Data\Helper\PostHelper');
68-
$postData = $postDataHelper->getPostData($block->getAddToCartUrl($_item), ['product' => $_item->getEntityId()])
69-
?>
70-
<button class="action tocart primary" data-post='<?= /* @noEscape */ $postData ?>' type="button" title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>">
71-
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
72-
</button>
73-
<?php endif; ?>
76+
</form>
7477
<?php else: ?>
7578
<?php if ($_item->getIsSalable()): ?>
7679
<div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div>

0 commit comments

Comments
 (0)