Skip to content

Commit 3afe4ca

Browse files
committed
MC-37069: Configurable Products with large quantities of children cannot be opened
1 parent 40f9a4b commit 3afe4ca

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/dynamic-rows-configurable.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,19 +219,18 @@ define([
219219
_.each(tmpData, function (row, index) {
220220
path = this.dataScope + '.' + this.index + '.' + (this.startIndex + index);
221221
row.attributes = $('<i></i>').text(row.attributes).html();
222-
row.sku = row.sku;
223222
this.source.set(path, row);
224223
}, this);
225224

226225
this.source.set(this.dataScope + '.' + this.index, data);
227226
this.parsePagesData(data);
228227

229228
// Render
230-
dataCount = data.length;
229+
dataCount = tmpData.length;
231230
elemsCount = this.elems().length;
232231

233232
if (dataCount > elemsCount) {
234-
this.getChildItems().each(function (elemData, index) {
233+
tmpData.each(function (elemData, index) {
235234
this.addChild(elemData, this.startIndex + index);
236235
}, this);
237236
} else {

app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,13 +1126,15 @@ define([
11261126
* Update whether value differs from default value
11271127
*/
11281128
setDifferedFromDefault: function () {
1129-
var recordData = utils.copy(this.recordData());
1129+
if (this.default) {
1130+
var recordData = utils.copy(this.recordData());
11301131

1131-
Array.isArray(recordData) && recordData.forEach(function (item) {
1132-
delete item['record_id'];
1133-
});
1132+
Array.isArray(recordData) && recordData.forEach(function (item) {
1133+
delete item['record_id'];
1134+
});
11341135

1135-
this.isDifferedFromDefault(!_.isEqual(recordData, this.default));
1136+
this.isDifferedFromDefault(!_.isEqual(recordData, this.default));
1137+
}
11361138
},
11371139

11381140
/**

lib/web/mage/utils/objects.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -247,16 +247,7 @@ define([
247247
* @returns {Object|Array} Cloned object.
248248
*/
249249
copy: function (data) {
250-
var result = data,
251-
isArray = Array.isArray(data),
252-
placeholder;
253-
254-
if (this.isObject(data) || isArray) {
255-
placeholder = isArray ? [] : {};
256-
result = this.extend(placeholder, data);
257-
}
258-
259-
return result;
250+
return _.clone(data)
260251
},
261252

262253
/**

0 commit comments

Comments
 (0)