Skip to content
This repository was archived by the owner on Dec 19, 2019. It is now read-only.

Commit fce11d6

Browse files
[EngCom] Public Pull Requests - 2.3-develop
- merged latest code from mainline branch
2 parents bf63db6 + 00fb2aa commit fce11d6

File tree

102 files changed

+1716
-845
lines changed

Some content is hidden

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

102 files changed

+1716
-845
lines changed

app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
99
<body>
1010
<referenceContainer name="notifications">
11-
<uiComponent name="notification_area"/>
11+
<uiComponent name="notification_area" aclResource="Magento_AdminNotification::show_list"/>
1212
<block class="Magento\AdminNotification\Block\System\Messages\UnreadMessagePopup"
1313
name="unread_system_messages"
1414
as="unread_system_messages"

app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminOrderBraintreeFillActionGroup.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,24 @@
1919

2020
<!--Choose Master Card from drop-down list-->
2121
<switchToIFrame stepKey="switchToCardNumber" selector="{{NewOrderSection.cardFrame}}"/>
22+
<waitForElementVisible selector="{{NewOrderSection.creditCardNumber}}" stepKey="waitForFillCardNumber"/>
2223
<fillField stepKey="fillCardNumber" selector="{{NewOrderSection.creditCardNumber}}" userInput="{{PaymentAndShippingInfo.cardNumber}}"/>
23-
<waitForPageLoad stepKey="waitForFillCardNumber"/>
2424
<switchToIFrame stepKey="switchBackFromCard"/>
2525

2626
<!--Fill expire date-->
2727
<switchToIFrame stepKey="switchToExpirationMonth" selector="{{NewOrderSection.monthFrame}}"/>
28+
<waitForElementVisible selector="{{NewOrderSection.expirationMonth}}" stepKey="waitForFillMonth"/>
2829
<fillField stepKey="fillMonth" selector="{{NewOrderSection.expirationMonth}}" userInput="{{PaymentAndShippingInfo.month}}"/>
29-
<waitForPageLoad stepKey="waitForFillMonth"/>
3030
<switchToIFrame stepKey="switchBackFromMonth"/>
3131
<switchToIFrame stepKey="switchToExpirationYear" selector="{{NewOrderSection.yearFrame}}"/>
32+
<waitForElementVisible selector="{{NewOrderSection.expirationYear}}" stepKey="waitForFillYear"/>
3233
<fillField stepKey="fillYear" selector="{{NewOrderSection.expirationYear}}" userInput="{{PaymentAndShippingInfo.year}}"/>
33-
<waitForPageLoad stepKey="waitForFillYear"/>
3434
<switchToIFrame stepKey="switchBackFromYear"/>
3535

3636
<!--Fill CVW code-->
3737
<switchToIFrame stepKey="switchToCVV" selector="{{NewOrderSection.cvvFrame}}"/>
38+
<waitForElementVisible selector="{{NewOrderSection.cvv}}" stepKey="waitForFillCVV"/>
3839
<fillField stepKey="fillCVV" selector="{{NewOrderSection.cvv}}" userInput="{{PaymentAndShippingInfo.cvv}}"/>
39-
<wait stepKey="waitForFillCVV" time="1"/>
4040
<switchToIFrame stepKey="switchBackFromCVV"/>
4141
</actionGroup>
4242
</actionGroups>

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

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

2522

@@ -63,21 +60,25 @@
6360
<argument name="customer" value="Simple_US_Customer"/>
6461
</actionGroup>
6562

63+
<!--Add Product to Order-->
6664
<actionGroup ref="addSimpleProductToOrder" stepKey="addProduct">
6765
<argument name="product" value="_defaultProduct"/>
6866
</actionGroup>
6967

68+
<!--Fill Order Customer Information-->
7069
<actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress">
7170
<argument name="customer" value="Simple_US_Customer"/>
7271
<argument name="address" value="US_Address_TX"/>
7372
</actionGroup>
7473

74+
<!--Select Shipping-->
7575
<actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShipping"/>
76-
7776
<waitForPageLoad stepKey="waitForShippingToFinish"/>
7877

78+
<!--Pay with Braintree -->
7979
<actionGroup ref="useBraintreeForMasterCard" stepKey="selectCardWithBraintree"/>
8080

81+
<!--Submit Order-->
8182
<click stepKey="submitOrder" selector="{{NewOrderSection.submitOrder}}"/>
8283
<waitForPageLoad stepKey="waitForSaveConfig"/>
8384
<waitForElementVisible selector="{{NewOrderSection.successMessage}}" stepKey="waitForSuccessMessage"/>

app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Inventory.php

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
*/
66
namespace Magento\Catalog\Block\Adminhtml\Product\Edit\Action\Attribute\Tab;
77

8-
use Magento\Customer\Api\Data\GroupInterface;
9-
108
/**
119
* Products mass update inventory tab
1210
*
@@ -31,29 +29,20 @@ class Inventory extends \Magento\Backend\Block\Widget implements \Magento\Backen
3129
*/
3230
protected $disabledFields = [];
3331

34-
/**
35-
* @var \Magento\Framework\Serialize\SerializerInterface
36-
*/
37-
private $serializer;
38-
3932
/**
4033
* @param \Magento\Backend\Block\Template\Context $context
4134
* @param \Magento\CatalogInventory\Model\Source\Backorders $backorders
4235
* @param \Magento\CatalogInventory\Api\StockConfigurationInterface $stockConfiguration
4336
* @param array $data
44-
* @param \Magento\Framework\Serialize\SerializerInterface|null $serializer
4537
*/
4638
public function __construct(
4739
\Magento\Backend\Block\Template\Context $context,
4840
\Magento\CatalogInventory\Model\Source\Backorders $backorders,
4941
\Magento\CatalogInventory\Api\StockConfigurationInterface $stockConfiguration,
50-
array $data = [],
51-
\Magento\Framework\Serialize\SerializerInterface $serializer = null
42+
array $data = []
5243
) {
5344
$this->_backorders = $backorders;
5445
$this->stockConfiguration = $stockConfiguration;
55-
$this->serializer = $serializer ?? \Magento\Framework\App\ObjectManager::getInstance()
56-
->get(\Magento\Framework\Serialize\SerializerInterface::class);
5746
parent::__construct($context, $data);
5847
}
5948

@@ -85,9 +74,7 @@ public function getFieldSuffix()
8574
*/
8675
public function getStoreId()
8776
{
88-
$storeId = (int)$this->getRequest()->getParam('store');
89-
90-
return $storeId;
77+
return (int)$this->getRequest()->getParam('store');
9178
}
9279

9380
/**
@@ -101,22 +88,6 @@ public function getDefaultConfigValue($field)
10188
return $this->stockConfiguration->getDefaultConfigValue($field);
10289
}
10390

104-
/**
105-
* Returns min_sale_qty configuration for the ALL Customer Group
106-
*
107-
* @return float
108-
*/
109-
public function getDefaultMinSaleQty()
110-
{
111-
$default = $this->stockConfiguration->getDefaultConfigValue('min_sale_qty');
112-
if (!is_numeric($default)) {
113-
$default = $this->serializer->unserialize($default);
114-
$default = $default[GroupInterface::CUST_GROUP_ALL] ?? 1;
115-
}
116-
117-
return (float) $default;
118-
}
119-
12091
/**
12192
* Tab settings
12293
*

app/code/Magento/Catalog/Model/Category.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,6 @@ class Category extends \Magento\Catalog\Model\AbstractModel implements
7272

7373
const CACHE_TAG = 'cat_c';
7474

75-
/**
76-
* Category Store Id
77-
*/
78-
const STORE_ID = 'store_id';
79-
8075
/**#@-*/
8176
protected $_eventPrefix = 'catalog_category';
8277

@@ -573,8 +568,8 @@ public function getStoreIds()
573568
*/
574569
public function getStoreId()
575570
{
576-
if ($this->hasData(self::STORE_ID)) {
577-
return (int)$this->_getData(self::STORE_ID);
571+
if ($this->hasData('store_id')) {
572+
return (int)$this->_getData('store_id');
578573
}
579574
return (int)$this->_storeManager->getStore()->getId();
580575
}
@@ -590,7 +585,7 @@ public function setStoreId($storeId)
590585
if (!is_numeric($storeId)) {
591586
$storeId = $this->_storeManager->getStore($storeId)->getId();
592587
}
593-
$this->setData(self::STORE_ID, $storeId);
588+
$this->setData('store_id', $storeId);
594589
$this->getResource()->setStoreId($storeId);
595590
return $this;
596591
}

app/code/Magento/Catalog/Model/ImageExtractor.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class ImageExtractor implements TypeDataExtractorInterface
2020
* @param \DOMElement $mediaNode
2121
* @param string $mediaParentTag
2222
* @return array
23+
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
2324
*/
2425
public function process(\DOMElement $mediaNode, $mediaParentTag)
2526
{
@@ -40,6 +41,12 @@ public function process(\DOMElement $mediaNode, $mediaParentTag)
4041
$nodeValue = $this->processImageBackground($attribute->nodeValue);
4142
} elseif ($attributeTagName === 'width' || $attributeTagName === 'height') {
4243
$nodeValue = (int) $attribute->nodeValue;
44+
} elseif ($attributeTagName === 'constrain'
45+
|| $attributeTagName === 'aspect_ratio'
46+
|| $attributeTagName === 'frame'
47+
|| $attributeTagName === 'transparency'
48+
) {
49+
$nodeValue = in_array($attribute->nodeValue, [true, 1, 'true', '1'], true) ?? false;
4350
} else {
4451
$nodeValue = $attribute->nodeValue;
4552
}

app/code/Magento/Catalog/Model/Product.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,6 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements
7171
*/
7272
const STORE_ID = 'store_id';
7373

74-
/**
75-
* Product Url path.
76-
*/
77-
const URL_PATH = 'url_path';
78-
7974
/**
8075
* @var string
8176
*/

app/code/Magento/Catalog/Model/Product/Copier.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function copy(Product $product)
8383
? $matches[1] . '-' . ($matches[2] + 1)
8484
: $urlKey . '-1';
8585
$duplicate->setUrlKey($urlKey);
86-
$duplicate->setData(Product::URL_PATH, null);
86+
$duplicate->setData('url_path', null);
8787
try {
8888
$duplicate->save();
8989
$isDuplicateSaved = true;

app/code/Magento/Catalog/Model/Product/Image/ParamsBuilder.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,7 @@ private function getWatermark(string $type): array
161161
*/
162162
private function hasDefaultFrame(): bool
163163
{
164-
return (bool) $this->viewConfig->getViewConfig()->getVarValue(
165-
'Magento_Catalog',
166-
'product_image_white_borders'
167-
);
164+
return (bool) $this->viewConfig->getViewConfig(['area' => \Magento\Framework\App\Area::AREA_FRONTEND])
165+
->getVarValue('Magento_Catalog', 'product_image_white_borders');
168166
}
169167
}

app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/InventoryTest.php

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
*/
66
namespace Magento\Catalog\Test\Unit\Block\Adminhtml\Product\Edit\Action\Attribute\Tab;
77

8-
use Magento\Customer\Api\Data\GroupInterface;
9-
108
/**
119
* Class InventoryTest
1210
*/
@@ -70,8 +68,7 @@ protected function setUp()
7068
[
7169
'context' => $this->contextMock,
7270
'backorders' => $this->backordersMock,
73-
'stockConfiguration' => $this->stockConfigurationMock,
74-
'serializer' => new \Magento\Framework\Serialize\Serializer\Json(),
71+
'stockConfiguration' => $this->stockConfigurationMock
7572
]
7673
);
7774
}
@@ -129,32 +126,6 @@ public function testGetDefaultConfigValue()
129126
$this->assertEquals('return-value', $this->inventory->getDefaultConfigValue('field-name'));
130127
}
131128

132-
/**
133-
* @dataProvider getDefaultMinSaleQtyDataProvider
134-
* @param string $expected
135-
* @param string $default
136-
*/
137-
public function testGetDefaultMinSaleQty($expected, $default)
138-
{
139-
$this->stockConfigurationMock->method('getDefaultConfigValue')->willReturn($default);
140-
$this->assertEquals($expected, $this->inventory->getDefaultMinSaleQty());
141-
}
142-
143-
public function getDefaultMinSaleQtyDataProvider()
144-
{
145-
return [
146-
'single-default-value' => [
147-
22, '22'
148-
],
149-
'no-default-for-all-group' => [
150-
1, json_encode(['12' => '111'])
151-
],
152-
'default-for-all-group' => [
153-
5, json_encode(['12' => '111', GroupInterface::CUST_GROUP_ALL => '5'])
154-
]
155-
];
156-
}
157-
158129
/**
159130
* Run test getTabLabel method
160131
*

app/code/Magento/Catalog/Test/Unit/Model/_files/converted_view.php

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,41 @@
1111
"type" => "swatch_thumb",
1212
"width" => 75,
1313
"height" => 75,
14-
"background" => [255, 25, 2]
14+
"constrain" => false,
15+
"aspect_ratio" => false,
16+
"frame" => false,
17+
"transparency" => false,
18+
"background" => [255, 25, 2],
19+
],
20+
"swatch_thumb_medium" => [
21+
"type" => "swatch_medium",
22+
"width" => 750,
23+
"height" => 750,
24+
"constrain" => true,
25+
"aspect_ratio" => true,
26+
"frame" => true,
27+
"transparency" => true,
28+
"background" => [255, 25, 2],
29+
],
30+
"swatch_thumb_large" => [
31+
"type" => "swatch_large",
32+
"width" => 1080,
33+
"height" => 720,
34+
"constrain" => false,
35+
"aspect_ratio" => false,
36+
"frame" => false,
37+
"transparency" => false,
38+
"background" => [255, 25, 2],
39+
],
40+
"swatch_thumb_small" => [
41+
"type" => "swatch_small",
42+
"width" => 100,
43+
"height" => 100,
44+
"constrain" => true,
45+
"aspect_ratio" => true,
46+
"frame" => true,
47+
"transparency" => true,
48+
"background" => [255, 25, 2],
1549
]
1650
]
1751
]

app/code/Magento/Catalog/Test/Unit/Model/_files/valid_view.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,37 @@
1111
<image id="swatch_thumb_base" type="swatch_thumb">
1212
<width>75</width>
1313
<height>75</height>
14+
<constrain>false</constrain>
15+
<aspect_ratio>false</aspect_ratio>
16+
<frame>false</frame>
17+
<transparency>false</transparency>
18+
<background>[255, 25, 2]</background>
19+
</image>
20+
<image id="swatch_thumb_medium" type="swatch_medium">
21+
<width>750</width>
22+
<height>750</height>
23+
<constrain>true</constrain>
24+
<aspect_ratio>true</aspect_ratio>
25+
<frame>true</frame>
26+
<transparency>true</transparency>
27+
<background>[255, 25, 2]</background>
28+
</image>
29+
<image id="swatch_thumb_large" type="swatch_large">
30+
<width>1080</width>
31+
<height>720</height>
32+
<constrain>0</constrain>
33+
<aspect_ratio>0</aspect_ratio>
34+
<frame>0</frame>
35+
<transparency>0</transparency>
36+
<background>[255, 25, 2]</background>
37+
</image>
38+
<image id="swatch_thumb_small" type="swatch_small">
39+
<width>100</width>
40+
<height>100</height>
41+
<constrain>1</constrain>
42+
<aspect_ratio>1</aspect_ratio>
43+
<frame>1</frame>
44+
<transparency>1</transparency>
1445
<background>[255, 25, 2]</background>
1546
</image>
1647
</images>

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/action/inventory.phtml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@
3030
});
3131
</script>
3232

33+
<?php
34+
$defaultMinSaleQty = $block->getDefaultConfigValue('min_sale_qty');
35+
if (!is_numeric($defaultMinSaleQty)) {
36+
$defaultMinSaleQty = json_decode($defaultMinSaleQty, true);
37+
$defaultMinSaleQty = (float) $defaultMinSaleQty[\Magento\Customer\Api\Data\GroupInterface::CUST_GROUP_ALL] ?? 1;
38+
}
39+
?>
3340
<div class="fieldset-wrapper form-inline advanced-inventory-edit">
3441
<div class="fieldset-wrapper-title">
3542
<strong class="title">
@@ -132,7 +139,7 @@
132139
<div class="field">
133140
<input type="text" class="input-text validate-number" id="inventory_min_sale_qty"
134141
name="<?= /* @escapeNotVerified */ $block->getFieldSuffix() ?>[min_sale_qty]"
135-
value="<?= /* @escapeNotVerified */ $block->getDefaultMinSaleQty() * 1 ?>"
142+
value="<?= /* @escapeNotVerified */ $defaultMinSaleQty ?>"
136143
disabled="disabled"/>
137144
</div>
138145
<div class="field choice">

0 commit comments

Comments
 (0)