magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.55k stars 9.32k forks source link

Duplication of bundle product removes bundle selection from original product #38990

Open jcnme opened 3 months ago

jcnme commented 3 months ago

Preconditions and environment

Steps to reproduce

  1. Create simple product
  2. Create bundle product
  3. Add option to bundle product
  4. Add simple product to option
  5. Save bundle product
  6. Save and duplicate bundle product

Expected result

Both the original and duplicated bundle products should contain the simple product as a selection to bundle option.

Actual result

Only the duplicated bundle product contains the simple product as as a selection to bundle option. The original bundle product's bundle option selection is removed.

Additional information

No response

Release note

No response

Triage and priority

m2-assistant[bot] commented 3 months ago

Hi @jcnme. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

jcnme commented 3 months ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 3 months ago

Hi @jcnme. Thank you for your request. I'm working on Magento instance for you.

m2-assistant[bot] commented 3 months ago

Hi @engcom-Bravo. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

magento-deployment-service[bot] commented 3 months ago

Hi @jcnme, here is your Magento Instance: https://ce8d2ef9ac0632e3cb97ac65074ecac5.instances-prod.magento-community.engineering Admin access: https://ce8d2ef9ac0632e3cb97ac65074ecac5.instances-prod.magento-community.engineering/admin_6687 Login: cd3b898a Password: 233910399cbe

jcnme commented 3 months ago

image image

engcom-Bravo commented 3 months ago

Hi @jcnme,

Thanks for your reporting and collaboration.

We have verified the issue in Latest 2.4-develop instance and the issue is reproducible.Kindly refer the screenshots.

Steps to reproduce

Screenshot 2024-07-31 at 09 35 25 Screenshot 2024-07-31 at 09 36 02

Only the duplicated bundle product contains the simple product as as a selection to bundle option. The original bundle product's bundle option selection is removed.

Hence Confirming the issue.

Thanks.

github-jira-sync-bot commented 3 months ago

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-12648 is successfully created for this GitHub issue.

m2-assistant[bot] commented 3 months ago

:white_check_mark: Confirmed by @engcom-Bravo. Thank you for verifying the issue.
Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

Nuranto commented 3 months ago

Hello,

Here's a quick fix :

            "magento/module-bundle": {
                "Duplication bundle issue - https://github.com/magento/magento2/issues/38990": "patches/composer/magento/bundle/issue-38990.patch"
            },
--- a/Model/LinkManagement.php  2024-04-03 16:20:20
+++ b/Model/LinkManagement.php  2024-08-12 09:48:10
@@ -244,6 +244,9 @@
         );

         $selectionModel->setOptionId($optionId);
+        if ($product->getIsDuplicate()) {
+            $selectionModel->setSelectionId(null);
+        }

         try {
             $selectionModel->save();