Skip to content

Commit 2e31990

Browse files
committed
ACP2E-2173: Scheduled update for a bundle product causes an exception for the bundle product already in a cart
1 parent d175da2 commit 2e31990

File tree

1 file changed

+8
-12
lines changed
  • app/code/Magento/BundleImportExport/Model/Import/Product/Type

1 file changed

+8
-12
lines changed

app/code/Magento/BundleImportExport/Model/Import/Product/Type/Bundle.php

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -343,18 +343,18 @@ protected function populateSelectionTemplate($selection, $optionId, $parentId, $
343343
/**
344344
* Set cache option selection
345345
*
346-
* @param mixed $existingSelection
347-
* @param mixed $optionTitle
346+
* @param array $existingSelection
347+
* @param string $optionTitle
348348
* @param string $selectIndex
349-
* @param mixed $key
349+
* @param string $key
350350
* @param string $origKey
351351
* @return void
352352
*/
353353
private function setCacheOptionSelection(
354-
mixed $existingSelection,
355-
mixed $optionTitle,
354+
array $existingSelection,
355+
string $optionTitle,
356356
string $selectIndex,
357-
mixed $key,
357+
string $key,
358358
string $origKey
359359
): void {
360360
if (!isset($this->_cachedOptions[$existingSelection['parent_product_id']]
@@ -565,12 +565,8 @@ protected function populateExistingSelections($existingOptions)
565565
if ($productId == $existingSelection['product_id']) {
566566
foreach (array_keys($existingSelection) as $origKey) {
567567
$key = $this->_bundleFieldMapping[$origKey] ?? $origKey;
568-
if (
569-
!isset($this->_cachedOptions[$existingSelection['parent_product_id']][$optionTitle]['selections'][$selectIndex][$key])
570-
) {
571-
$this->_cachedOptions[$existingSelection['parent_product_id']][$optionTitle]['selections'][$selectIndex][$key] =
572-
$existingSelection[$origKey];
573-
}
568+
$this->setCacheOptionSelection($existingSelection, (string) $optionTitle,
569+
(string) $selectIndex, (string) $key, (string) $origKey);
574570
}
575571
break;
576572
}

0 commit comments

Comments
 (0)