Skip to content

Commit 6e85800

Browse files
committed
ACP2E-2909: dynamic-rows.js:658 Uncaught TypeError: dataRecord.slice while editing bundle products
- Fixed the issue while delete is not happening when single row is present.
1 parent c018ea4 commit 6e85800

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/code/Magento/Bundle/Model/Product/SaveHandler.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,14 @@ public function execute($entity, $arguments = [])
9595
{
9696
/** @var OptionInterface[] $bundleProductOptions */
9797
$bundleProductOptions = $entity->getExtensionAttributes()->getBundleProductOptions() ?: [];
98+
$existingBundleProductOptions = $this->optionRepository->getList($entity->getSku());
9899
//Only processing bundle products.
99-
if ($entity->getTypeId() !== Type::TYPE_CODE || empty($bundleProductOptions)) {
100+
if ($entity->getTypeId() !== Type::TYPE_CODE ||
101+
(empty($bundleProductOptions) && empty($existingBundleProductOptions))
102+
) {
100103
return $entity;
101104
}
102105

103-
$existingBundleProductOptions = $this->optionRepository->getList($entity->getSku());
104106
$existingOptionsIds = !empty($existingBundleProductOptions)
105107
? $this->getOptionIds($existingBundleProductOptions)
106108
: [];

0 commit comments

Comments
 (0)