Skip to content

Commit fbfd7ff

Browse files
author
Yevhen Miroshnychenko
committed
Merge branch '2.3-develop' into MAGETWO-91934
2 parents f3c9417 + af84959 commit fbfd7ff

File tree

178 files changed

+4778
-1329
lines changed

Some content is hidden

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

178 files changed

+4778
-1329
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
1-
<!--- Provide a general summary of the issue in the Title above -->
2-
<!--- Before adding new issues, please, check this article https://github.com/magento/magento2/wiki/Issue-reporting-guidelines-->
1+
<!---
2+
Thank you for contributing to Magento.
3+
To help us process this issue we recommend that you add the following information:
4+
- Summary of the issue,
5+
- Information on your environment,
6+
- Steps to reproduce,
7+
- Expected and actual results,
8+
9+
Please also have a look at our guidelines article before adding a new issue https://github.com/magento/magento2/wiki/Issue-reporting-guidelines
10+
-->
311

412
### Preconditions
5-
<!--- Provide a more detailed information of environment you use -->
6-
<!--- Magento version, tag, HEAD, etc., PHP & MySQL version, etc.. -->
13+
<!---
14+
Please provide as detailed information about your environment as possible.
15+
For example Magento version, tag, HEAD, PHP & MySQL version, etc..
16+
-->
717
1.
818
2.
919

1020
### Steps to reproduce
11-
<!--- Provide a set of unambiguous steps to reproduce this bug include code, if relevant -->
21+
<!---
22+
It is important to provide a set of clear steps to reproduce this bug.
23+
If relevant please include code samples
24+
-->
1225
1.
1326
2.
1427
3.
1528

1629
### Expected result
1730
<!--- Tell us what should happen -->
18-
1.
31+
1. [Screenshot, logs]
1932

2033
### Actual result
2134
<!--- Tell us what happens instead -->
2235
1. [Screenshot, logs]
23-
24-
<!--- (This may be platform independent comment) -->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,32 @@
1-
<!--- Provide a general summary of the Pull Request in the Title above -->
1+
<!---
2+
Thank you for contributing to Magento.
3+
To help us process this pull request we recommend that you add the following information:
4+
- Summary of the pull request,
5+
- Issue(s) related to the changes made,
6+
- Manual testing scenarios,
7+
-->
8+
9+
<!--- Please provide a general summary of the Pull Request in the Title above -->
210

311
### Description
4-
<!--- Provide a description of the changes proposed in the pull request -->
12+
<!---
13+
Please provide a description of the changes proposed in the pull request.
14+
Letting us know what has changed and why it needed changing will help us validate this pull request.
15+
-->
516

617
### Fixed Issues (if relevant)
7-
<!--- Provide a list of fixed issues in the format magento/magento2#<issue_number>, if relevant -->
18+
<!---
19+
If relevant, please provide a list of fixed issues in the format magento/magento2#<issue_number>.
20+
There could be 1 or more issues linked here and it will help us find some more information about the reasoning behind this change.
21+
-->
822
1. magento/magento2#<issue_number>: Issue title
923
2. ...
1024

1125
### Manual testing scenarios
12-
<!--- Provide a set of unambiguous steps to test the proposed code change -->
26+
<!---
27+
Please provide a set of unambiguous steps to test the proposed code change.
28+
Giving us manual testing scenarios will help with the processing and validation process.
29+
-->
1330
1. ...
1431
2. ...
1532

app/code/Magento/Backend/etc/adminhtml/di.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,6 @@
144144
<argument name="configs" xsi:type="array">
145145
<item name="dev" xsi:type="const">Magento\Config\Model\Config\Structure\ElementVisibilityInterface::HIDDEN</item>
146146
</argument>
147-
<argument name="exemptions" xsi:type="array">
148-
<item name="dev/debug/debug_logging" xsi:type="string"/>
149-
</argument>
150147
</arguments>
151148
</type>
152149
<type name="Magento\Config\Model\Config\Structure\ElementVisibility\ConcealInProductionWithoutScdOnDemand">

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@
447447
<!-- PayPal value handlers infrastructure -->
448448
<type name="Magento\Braintree\Gateway\Response\PayPal\VaultDetailsHandler">
449449
<arguments>
450-
<argument name="paymentTokenFactory" xsi:type="object">Magento\Vault\Model\AccountPaymentTokenFactory</argument>
450+
<argument name="paymentTokenFactory" xsi:type="object">Magento\Vault\Api\Data\PaymentTokenFactoryInterface</argument>
451451
</arguments>
452452
</type>
453453
<virtualType name="BraintreePayPalValueHandlerPool" type="Magento\Payment\Gateway\Config\ValueHandlerPool">

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

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,8 @@ protected function getBundleOptions()
314314
'template' => 'ui/dynamic-rows/templates/collapsible',
315315
'additionalClasses' => 'admin__field-wide',
316316
'dataScope' => 'data.bundle_options',
317-
'bundleSelectionsName' => 'product_bundle_container.bundle_selections'
317+
'isDefaultFieldScope' => 'is_default',
318+
'bundleSelectionsName' => 'product_bundle_container.bundle_selections',
318319
],
319320
],
320321
],
@@ -378,7 +379,10 @@ protected function getBundleOptions()
378379
'selection_qty' => '',
379380
],
380381
'links' => ['insertData' => '${ $.provider }:${ $.dataProvider }'],
381-
'source' => 'product'
382+
'imports' => [
383+
'inputType' => '${$.provider}:${$.dataScope}.type',
384+
],
385+
'source' => 'product',
382386
],
383387
],
384388
],
@@ -594,11 +598,14 @@ protected function getBundleSelections()
594598
'config' => [
595599
'componentType' => Container::NAME,
596600
'isTemplate' => true,
597-
'component' => 'Magento_Bundle/js/components/bundle-record',
601+
'component' => 'Magento_Ui/js/dynamic-rows/record',
598602
'is_collection' => true,
599603
'imports' => [
600-
'onTypeChanged' => '${ $.provider }:${ $.bundleOptionsDataScope }.type'
601-
]
604+
'inputType' => '${$.parentName}:inputType',
605+
],
606+
'exports' => [
607+
'isDefaultValue' => '${$.parentName}:isDefaultValue.${$.index}',
608+
],
602609
],
603610
],
604611
],
@@ -691,11 +698,15 @@ protected function getBundleSelections()
691698
'componentType' => Form\Field::NAME,
692699
'formElement' => Form\Element\Checkbox::NAME,
693700
'dataType' => Form\Element\DataType\Price::NAME,
701+
'component' => 'Magento_Bundle/js/components/bundle-user-defined-checkbox',
694702
'label' => __('User Defined'),
695703
'dataScope' => 'selection_can_change_qty',
696704
'value' => '1',
697705
'valueMap' => ['true' => '1', 'false' => '0'],
698706
'sortOrder' => 110,
707+
'imports' => [
708+
'inputType' => '${$.parentName}:inputType',
709+
],
699710
],
700711
],
701712
],

app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-checkbox.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ define([
1414
clearing: false,
1515
parentContainer: '',
1616
parentSelections: '',
17-
changer: ''
17+
changer: '',
18+
exports: {
19+
value: '${$.parentName}:isDefaultValue'
20+
}
1821
},
1922

2023
/**
@@ -58,10 +61,6 @@ define([
5861

5962
this.prefer = typeMap[type];
6063
this.elementTmpl(this.templates[typeMap[type]]);
61-
62-
if (this.prefer === 'radio' && this.checked()) {
63-
this.clearValues();
64-
}
6564
},
6665

6766
/**

app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-dynamic-rows-grid.js

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,57 @@ define([
1414
label: '',
1515
columnsHeader: false,
1616
columnsHeaderAfterRender: true,
17-
addButton: false
17+
addButton: false,
18+
isDefaultFieldScope: 'is_default',
19+
defaultRecords: {
20+
use: [],
21+
moreThanOne: false,
22+
state: {}
23+
},
24+
listens: {
25+
inputType: 'onInputTypeChange',
26+
isDefaultValue: 'onIsDefaultValue'
27+
}
28+
},
29+
30+
/**
31+
* Handler for type select.
32+
*
33+
* @param {String} inputType - changed.
34+
*/
35+
onInputTypeChange: function (inputType) {
36+
if (this.defaultRecords.moreThanOne && (inputType === 'radio' || inputType === 'select')) {
37+
_.each(this.defaultRecords.use, function (index, counter) {
38+
this.source.set(
39+
this.dataScope + '.bundle_selections.' + index + '.' + this.isDefaultFieldScope,
40+
counter ? '0' : '1'
41+
);
42+
}.bind(this));
43+
}
44+
},
45+
46+
/**
47+
* Handler for is_default field.
48+
*
49+
* @param {Object} data - changed data.
50+
*/
51+
onIsDefaultValue: function (data) {
52+
var cb,
53+
use = 0;
54+
55+
this.defaultRecords.use = [];
56+
57+
cb = function (elem, key) {
58+
59+
if (~~elem) {
60+
this.defaultRecords.use.push(key);
61+
use++;
62+
}
63+
64+
this.defaultRecords.moreThanOne = use > 1;
65+
}.bind(this);
66+
67+
_.each(data, cb);
1868
},
1969

2070
/**
@@ -29,7 +79,6 @@ define([
2979
recordIndex;
3080

3181
this.parsePagesData(data);
32-
this.templates.record.bundleOptionsDataScope = this.dataScope;
3382

3483
if (newData.length) {
3584
if (this.insertData().length) {
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([
7+
'Magento_Ui/js/form/element/single-checkbox'
8+
], function (Checkbox) {
9+
'use strict';
10+
11+
return Checkbox.extend({
12+
defaults: {
13+
listens: {
14+
inputType: 'onInputTypeChange'
15+
}
16+
},
17+
18+
/**
19+
* Handler for "inputType" property
20+
*
21+
* @param {String} data
22+
*/
23+
onInputTypeChange: function (data) {
24+
data === 'checkbox' || data === 'multi' ?
25+
this.clear()
26+
.visible(false) :
27+
this.visible(true);
28+
}
29+
});
30+
});

app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Save.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,7 @@ public function execute()
139139
->setName($name)
140140
->getAttributeSet();
141141
} catch (AlreadyExistsException $alreadyExists) {
142-
$this->messageManager->addErrorMessage(
143-
__('A "%1" attribute set name already exists. Create a new name and try again.', $name)
144-
);
142+
$this->messageManager->addErrorMessage(__('An attribute set named \'%1\' already exists.', $name));
145143
$this->_session->setAttributeData($data);
146144
return $this->returnResult('catalog/*/edit', ['_current' => true], ['error' => true]);
147145
} catch (LocalizedException $e) {
@@ -202,6 +200,8 @@ public function execute()
202200
}
203201
}
204202

203+
$data = $this->presentation->convertPresentationDataToInputType($data);
204+
205205
if ($attributeId) {
206206
if (!$model->getId()) {
207207
$this->messageManager->addErrorMessage(__('This attribute no longer exists.'));
@@ -216,7 +216,7 @@ public function execute()
216216

217217
$data['attribute_code'] = $model->getAttributeCode();
218218
$data['is_user_defined'] = $model->getIsUserDefined();
219-
$data['frontend_input'] = $model->getFrontendInput();
219+
$data['frontend_input'] = $data['frontend_input'] ?? $model->getFrontendInput();
220220
} else {
221221
/**
222222
* @todo add to helper and specify all relations for properties
@@ -229,8 +229,6 @@ public function execute()
229229
);
230230
}
231231

232-
$data = $this->presentation->convertPresentationDataToInputType($data);
233-
234232
$data += ['is_filterable' => 0, 'is_filterable_in_search' => 0];
235233

236234
if ($model->getIsUserDefined() === null || $model->getIsUserDefined() != 0) {

app/code/Magento/Catalog/Model/Indexer/Product/Eav/AbstractAction.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Catalog\Model\Indexer\Product\Eav;
77

8+
use Magento\Catalog\Model\ResourceModel\Product\Indexer\Eav\AbstractEav;
9+
810
/**
911
* Abstract action reindex class
1012
*/
@@ -51,7 +53,7 @@ abstract public function execute($ids);
5153
/**
5254
* Retrieve array of EAV type indexers
5355
*
54-
* @return \Magento\Catalog\Model\ResourceModel\Product\Indexer\Eav\AbstractEav[]
56+
* @return AbstractEav[]
5557
*/
5658
public function getIndexers()
5759
{
@@ -69,7 +71,7 @@ public function getIndexers()
6971
* Retrieve indexer instance by type
7072
*
7173
* @param string $type
72-
* @return \Magento\Catalog\Model\ResourceModel\Product\Indexer\Eav\AbstractEav
74+
* @return AbstractEav
7375
* @throws \Magento\Framework\Exception\LocalizedException
7476
*/
7577
public function getIndexer($type)
@@ -108,7 +110,7 @@ public function reindex($ids = null)
108110
/**
109111
* Synchronize data between index storage and original storage
110112
*
111-
* @param \Magento\Catalog\Model\ResourceModel\Product\Indexer\Eav\AbstractEav $indexer
113+
* @param AbstractEav $indexer
112114
* @param string $destinationTable
113115
* @param array $ids
114116
* @throws \Exception
@@ -134,16 +136,17 @@ protected function syncData($indexer, $destinationTable, $ids)
134136
/**
135137
* Retrieve product relations by children and parent
136138
*
137-
* @param \Magento\Catalog\Model\ResourceModel\Product\Indexer\Eav\AbstractEav $indexer
139+
* @param AbstractEav $indexer
138140
* @param array $ids
139-
*
140141
* @param bool $onlyParents
141142
* @return array $ids
142143
*/
143-
protected function processRelations($indexer, $ids, $onlyParents = false)
144+
protected function processRelations(AbstractEav $indexer, array $ids, bool $onlyParents = false)
144145
{
145146
$parentIds = $indexer->getRelationsByChild($ids);
147+
$parentIds = array_unique(array_merge($parentIds, $ids));
146148
$childIds = $onlyParents ? [] : $indexer->getRelationsByParent($parentIds);
149+
147150
return array_unique(array_merge($ids, $childIds, $parentIds));
148151
}
149152
}

0 commit comments

Comments
 (0)