Skip to content

Commit 2e62245

Browse files
committed
ACP2E-3076: Error when deleting bundle options
1 parent 5171542 commit 2e62245

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ define([
5555
this.source.set(path, optionBaseData);
5656
this.source.set(path + '.bundle_button_proxy', []);
5757
this.source.set(path + '.bundle_selections', []);
58-
this.removeBundleItemsFromOption(idx); // would be best to remove the entire html, but see first if remove from data works
58+
this.removeBundleItemsFromOption(idx);
5959
_.each(rec['bundle_selections'], function (obj, index) {
6060
this.source.set(path + '.bundle_button_proxy' + '.' + index, rec['bundle_button_proxy'][index]);
6161
this.source.set(path + '.bundle_selections' + '.' + index, obj);
@@ -72,6 +72,7 @@ define([
7272
*/
7373
removeBundleItemsFromOption: function (index) {
7474
let bundleSelections = registry.get(this.name + '.' + index + '.' + this.bundleSelectionsName);
75+
7576
bundleSelections.destroyChildren();
7677
},
7778

@@ -80,9 +81,9 @@ define([
8081
*/
8182
processingAddChild: function (ctx, index, prop) {
8283
var recordIds = _.map(this.recordData(), function (rec) {
83-
return parseInt(rec['record_id'], 10);
84-
}),
85-
maxRecordId = _.max(recordIds);
84+
return parseInt(rec['record_id'], 10);
85+
}),
86+
maxRecordId = _.max(recordIds);
8687

8788
prop = maxRecordId > -1 ? maxRecordId + 1 : prop;
8889
this._super(ctx, index, prop);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,8 +584,8 @@ define([
584584
updatedCollection;
585585

586586
if (this.elems().filter(function (el) {
587-
return el.position || el.position === 0;
588-
}).length !== this.getChildItems().length) {
587+
return el.position || el.position === 0;
588+
}).length !== this.getChildItems().length) {
589589

590590
return false;
591591
}

0 commit comments

Comments
 (0)