Skip to content

Commit 7c7afcb

Browse files
committed
ACP2E-2909: dynamic-rows.js:658 Uncaught TypeError: dataRecord.slice while editing bundle products
- Fixed the product save issue.
1 parent 57a07c8 commit 7c7afcb

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,7 @@ protected function processBundleOptionsData(\Magento\Catalog\Model\Product $prod
152152
if (!empty($linkData['selection_id'])) {
153153
$linkData['id'] = $linkData['selection_id'];
154154
}
155-
if (!empty($linkData['product_id'])) {
156-
$links[] = $this->buildLink($product, $linkData);
157-
}
155+
$links[] = $this->buildLink($product, $linkData);
158156
}
159157
$option->setProductLinks($links);
160158
$options[] = $option;

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,11 @@ define([
149149
if (newData.length) {
150150
if (this.insertData().length) {
151151
recordIndex = data.length - newData.length - 1;
152-
153-
_.each(newData, function (newRecord) {
154-
this.processingAddChild(newRecord, ++recordIndex, newRecord[this.identificationProperty]);
155-
}, this);
152+
if (!isNaN(recordIndex)) {
153+
_.each(newData, function (newRecord) {
154+
this.processingAddChild(newRecord, ++recordIndex, newRecord[this.identificationProperty]);
155+
}, this);
156+
}
156157
}
157158
}
158159

0 commit comments

Comments
 (0)