Skip to content

Commit 397fe72

Browse files
authored
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #12734: #6916 Fix notice during Update Bundle Product without changes (by @dzianis-yurevich) - #12875: Add more parameters to ajax:addToCart (by @srenon) - magento-engcom/magento2ce#1036: #12712: [GitHub] Latest Google Chrome Browser issue with duplicate id… (by @serhii-balko) - #12859: Throw ValidationException for invalid xml (by @pmclain) - magento-engcom/magento2ce#921: 8830: Can`t delete row in dynamicRows component (by @RomaKis) Fixed GitHub Issues: - #6916: Update Bundle Product without changes in bundle items (reported by @magecodenet) has been fixed in #12734 by @dzianis-yurevich in 2.2-develop branch Related commits: 1. e6a7a4e - #12712: Latest Google Chrome Browser issue with duplicate #email (reported by @lano-vargas) has been fixed in magento-engcom/magento2ce#1036 by @serhii-balko in 2.2-develop branch Related commits: 1. 781ec89 - #8830: Can`t delete row in dynamicRows component (reported by @MTheProgrammer) has been fixed in magento-engcom/magento2ce#921 by @RomaKis in 2.2-develop branch Related commits: 1. 0a6a2d9 2. 53c1fa3 3. 1ab55ec 4. cb24115 5. bfb2e38 6. 568d36e 7. 0a72897
2 parents 5d572a0 + e862fe8 commit 397fe72

File tree

12 files changed

+60
-39
lines changed

12 files changed

+60
-39
lines changed

app/code/Magento/Bundle/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Bundle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ protected function processBundleOptionsData(\Magento\Catalog\Model\Product $prod
127127
}
128128
$options = [];
129129
foreach ($bundleOptionsData as $key => $optionData) {
130-
if ((bool)$optionData['delete']) {
130+
if (!empty($optionData['delete'])) {
131131
continue;
132132
}
133133

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Attributes.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@ private function customizeAddAttributeModal(array $meta)
182182
. '.create_new_attribute_modal',
183183
'actionName' => 'toggleModal',
184184
],
185+
[
186+
'targetName' => 'product_form.product_form.add_attribute_modal'
187+
. '.create_new_attribute_modal.product_attribute_add_form',
188+
'actionName' => 'destroyInserted'
189+
],
185190
[
186191
'targetName'
187192
=> 'product_form.product_form.add_attribute_modal'

app/code/Magento/Catalog/view/adminhtml/ui_component/product_attribute_add_form.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@
147147
<item name="isTemplate" xsi:type="boolean">true</item>
148148
<item name="is_collection" xsi:type="boolean">true</item>
149149
<item name="componentType" xsi:type="string">container</item>
150-
<item name="positionProvider" xsi:type="string">attribute_options.position</item>
151150
</item>
152151
</argument>
153152
<field name="is_default" component="Magento_Catalog/js/form/element/checkbox" sortOrder="0" formElement="checkbox">
@@ -184,12 +183,8 @@
184183
</item>
185184
</argument>
186185
<settings>
187-
<additionalClasses>
188-
<class name="_hidden">true</class>
189-
</additionalClasses>
190186
<dataType>text</dataType>
191187
<visible>false</visible>
192-
<dataScope>position</dataScope>
193188
</settings>
194189
</field>
195190
</container>

app/code/Magento/Catalog/view/adminhtml/web/js/form/element/input.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,16 @@ define([
5454
if (!_.isEmpty(this.suffixName) || _.isNumber(this.suffixName)) {
5555
suffixName = '.' + this.suffixName;
5656
}
57-
this.dataScope = 'data.' + this.prefixName + '.' + this.elementName + suffixName;
5857

59-
this.links.value = this.provider + ':' + this.dataScope;
58+
this.exportDataLink = 'data.' + this.prefixName + '.' + this.elementName + suffixName;
59+
this.exports.value = this.provider + ':' + this.exportDataLink;
60+
},
61+
62+
/** @inheritdoc */
63+
destroy: function () {
64+
this._super();
65+
66+
this.source.remove(this.exportDataLink);
6067
},
6168

6269
/**

app/code/Magento/Catalog/view/adminhtml/web/template/form/element/action-delete.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<button class="action-delete"
88
attr="{'data-action': 'remove_row'}"
99
data-bind="
10-
click: function(){ $data.processingDeleteRecord($parents); },
10+
click: function(){ $parent.processingDeleteRecord($record().index, $record.recordId); },
1111
attr: {
1212
title: $parent.deleteButtonLabel
1313
}

app/code/Magento/Catalog/view/frontend/web/js/catalog-add-to-cart.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ define([
9797
success: function (res) {
9898
var eventData, parameters;
9999

100-
$(document).trigger('ajax:addToCart', form.data().productSku);
100+
$(document).trigger('ajax:addToCart', form.data().productSku, form, res);
101101

102102
if (self.isLoaderEnabled()) {
103103
$('body').trigger(self.options.processStop);

app/code/Magento/Config/Model/Config/Structure/Reader.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,20 @@ protected function _readFiles($fileList)
124124
* Processing nodes of the document before merging
125125
*
126126
* @param string $content
127+
* @throws \Magento\Framework\Config\Dom\ValidationException
127128
* @return string
128129
*/
129130
protected function processingDocument($content)
130131
{
131132
$object = new DataObject();
132133
$document = new \DOMDocument();
133134

134-
$document->loadXML($content);
135+
try {
136+
$document->loadXML($content);
137+
} catch (\Exception $e) {
138+
throw new \Magento\Framework\Config\Dom\ValidationException($e->getMessage());
139+
}
140+
135141
$this->compiler->compile($document->documentElement, $object, $object);
136142

137143
return $document->saveXML();

app/code/Magento/Customer/view/frontend/web/template/authentication-popup.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@
5454
id="login-form">
5555
<div class="fieldset login" data-bind="attr: {'data-hasrequired': $t('* Required Fields')}">
5656
<div class="field email required">
57-
<label class="label" for="email"><span data-bind="i18n: 'Email Address'"></span></label>
57+
<label class="label" for="customer-email"><span data-bind="i18n: 'Email Address'"></span></label>
5858
<div class="control">
5959
<input name="username"
60-
id="email"
60+
id="customer-email"
6161
type="email"
6262
class="input-text"
6363
data-bind="attr: {autocomplete: autocomplete}"

app/code/Magento/Swatches/view/adminhtml/ui_component/product_attribute_add_form.xml

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@
8787
<additionalClasses>
8888
<class name="admin__field-wide">true</class>
8989
</additionalClasses>
90-
<dataScope>text_swatch</dataScope>
9190
<componentType>dynamicRows</componentType>
9291
</settings>
9392
<container name="record" component="Magento_Ui/js/dynamic-rows/record">
@@ -96,8 +95,6 @@
9695
<item name="isTemplate" xsi:type="boolean">true</item>
9796
<item name="is_collection" xsi:type="boolean">true</item>
9897
<item name="componentType" xsi:type="string">container</item>
99-
<item name="positionProvider" xsi:type="string">text_swatch.position</item>
100-
<item name="dataScope" xsi:type="string"/>
10198
</item>
10299
</argument>
103100
<field name="defaulttext" component="Magento_Catalog/js/form/element/checkbox" sortOrder="0" formElement="checkbox">
@@ -183,15 +180,11 @@
183180
</item>
184181
</argument>
185182
<settings>
186-
<additionalClasses>
187-
<class name="_hidden">true</class>
188-
</additionalClasses>
189183
<dataType>text</dataType>
190184
<visible>false</visible>
191-
<dataScope>position</dataScope>
192185
</settings>
193186
</field>
194-
<actionDelete name="action_delete" component="Magento_Catalog/js/form/element/action-delete" template="Magento_Catalog/form/element/action-delete">
187+
<actionDelete name="action_delete">
195188
<argument name="data" xsi:type="array">
196189
<item name="config" xsi:type="array">
197190
<item name="fit" xsi:type="boolean">true</item>
@@ -227,7 +220,6 @@
227220
<class name="swatch-visual-options-container">true</class>
228221
<class name="admin__field-wide">true</class>
229222
</additionalClasses>
230-
<dataScope>visual_swatch</dataScope>
231223
<componentType>dynamicRows</componentType>
232224
</settings>
233225
<container name="record" component="Magento_Ui/js/dynamic-rows/record">
@@ -236,8 +228,6 @@
236228
<item name="isTemplate" xsi:type="boolean">true</item>
237229
<item name="is_collection" xsi:type="boolean">true</item>
238230
<item name="componentType" xsi:type="string">container</item>
239-
<item name="positionProvider" xsi:type="string">text_swatch.position</item>
240-
<item name="dataScope" xsi:type="string"/>
241231
</item>
242232
</argument>
243233
<field name="defaultvisual" component="Magento_Catalog/js/form/element/checkbox" sortOrder="0" formElement="checkbox">
@@ -276,7 +266,6 @@
276266
<class name="swatches-visual-col">true</class>
277267
</additionalClasses>
278268
<label translate="true">Swatch</label>
279-
<dataScope>swatchvisual</dataScope>
280269
</settings>
281270
</field>
282271
<field name="optionvisual_default_store_view" component="Magento_Catalog/js/form/element/input" template="Magento_Catalog/form/element/input" formElement="input">
@@ -290,7 +279,6 @@
290279
<settings>
291280
<dataType>text</dataType>
292281
<label translate="true">Default Store View</label>
293-
<dataScope>optionvisual_default_store_view</dataScope>
294282
</settings>
295283
</field>
296284
<field name="optionvisual_admin" component="Magento_Catalog/js/form/element/input" template="Magento_Catalog/form/element/input" formElement="input">
@@ -304,7 +292,6 @@
304292
<settings>
305293
<dataType>text</dataType>
306294
<label translate="true">Admin</label>
307-
<dataScope>optionvisual_admin</dataScope>
308295
</settings>
309296
</field>
310297
<field name="position" component="Magento_Catalog/js/form/element/input" formElement="input">
@@ -315,15 +302,10 @@
315302
</item>
316303
</argument>
317304
<settings>
318-
<additionalClasses>
319-
<class name="_hidden">true</class>
320-
</additionalClasses>
321-
<dataType>text</dataType>
322-
<visible>false</visible>
323-
<dataScope>position</dataScope>
305+
<visible>false</visible>
324306
</settings>
325307
</field>
326-
<actionDelete name="action_delete" component="Magento_Catalog/js/form/element/action-delete" template="Magento_Catalog/form/element/action-delete">
308+
<actionDelete name="action_delete">
327309
<argument name="data" xsi:type="array">
328310
<item name="config" xsi:type="array">
329311
<item name="fit" xsi:type="boolean">true</item>

app/code/Magento/Swatches/view/adminhtml/web/js/form/element/swatch-visual.js

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,18 +305,30 @@ define([
305305
*/
306306
initialize: function () {
307307
this._super()
308-
.initOldCode();
308+
.initOldCode()
309+
.on('value', this.onChangeColor.bind(this));
309310

310311
return this;
311312
},
312313

314+
/**
315+
* Handler function that execute when color changes.
316+
*
317+
* @param {String} data - color
318+
*/
319+
onChangeColor: function (data) {
320+
if (!data) {
321+
jQuery('.' + this.elementName).parent().removeClass('unavailable');
322+
}
323+
},
324+
313325
/**
314326
* Initialize wrapped former implementation.
315327
*
316328
* @returns {Object} Chainable.
317329
*/
318330
initOldCode: function () {
319-
jQuery.async('.' + this.elementName, function (elem) {
331+
jQuery.async('.' + this.elementName, this.name, function (elem) {
320332
oldCode(this.value(), elem.parentElement, this.uploadUrl, this.elementName);
321333
}.bind(this));
322334

@@ -336,9 +348,15 @@ define([
336348
this.elementName = this.prefixElementName + recordId;
337349

338350
this.inputName = prefixName + '[' + this.elementName + ']';
339-
this.dataScope = 'data.' + this.prefixName + '.' + this.elementName;
351+
this.exportDataLink = 'data.' + this.prefixName + '.' + this.elementName;
352+
this.exports.value = this.provider + ':' + this.exportDataLink;
353+
},
354+
355+
/** @inheritdoc */
356+
destroy: function () {
357+
this._super();
340358

341-
this.links.value = this.provider + ':' + this.dataScope;
359+
this.source.remove(this.exportDataLink);
342360
},
343361

344362
/**

0 commit comments

Comments
 (0)