Magento2: Bundle option id changes every time when editing on admin page

Created on 8 May 2017  路  13Comments  路  Source: magento/magento2

Bundle option id changes every time when editing on admin page

Preconditions

  1. Version 2.1.5

Steps to reproduce

  1. create bundle product with some options -> save product
  2. click save button again then

Expected result

  1. the product is updated and the bundle option ids does not change.

Actual result

  1. the bundle option ids are recreated every time the product is saved.
Catalog Fixed in 2.2.x Format is valid Ready for Work needs update bug report

All 13 comments

Having same issue the options are duplicated after save product.... looking for some fix regarding this........

Version: Magento CE 2.1.6
Same issue

2.1.5 CE too

I also have this issue with drop-down options
Magento CE 2.1.5

This is a major issue for anyone doing any kind of integration or relying on Reorder functionality as it also breaks re-order functionality. Is there any ETA on this getting fixed. Can someone from Magento acknowledge this issue. It's the same issue as for custom options on simple products.

@NisaKH We cannot reproduce this issue as described. Please provide the detailed steps we must follow to reproduce this issue. In addition, identify the web server you are running, the versions of PHP and MySQL, and any other information needed to reproduce your issue.

@Stas94 I can reproduce the issue with PHP 7.0.15 and 7.0.16.
To reproduce the issue see records in catalog_product_bundle_selection table and choose some product_id. Then open to edit that product and just save it.
Now refresh catalog_product_bundle_selection table and see how the entities have new selection_id values.
It's the same for custom options.

@NisaKH , @miro91 Thanks for reporting this issue. We've created internal ticket MAGETWO-70276 to address this issue.

This is a weird issue happening in Magento EE 2.1.1 also. This will create an issue if your product page is cached in the storefront and you update the bundle in the backend.

Delete and Insert of options is happening in the class: vendor/magento/module-bundle/Model/Product/SaveHandler.php::execute()

foreach ($this->optionRepository->getList($entity->getSku()) as $option) {
    $this->removeOptionLinks($entity->getSku(), $option);
    $this->optionRepository->delete($option);
}

Not sure removing this should work without side-effects. Gonna investigate more and update here.

And because of this there is a related issue: https://github.com/magento/magento2/issues/5192

Apparently going to be fixed in 2.2 : https://github.com/magento/magento2/commit/f19ea67cf7dccbc1a36668eff1bf10c42e9712fc

Anyone willing to make a 2.1 version?

@PascalBrouwers I can confirm that it's fixed in 2.2.0
Maybe we will need to wait for the official release of 2.2 which is expected to be end of this month or beginning of September which is not too bad

I have Same issue in Magento-2.1.12-CE.

Was this page helpful?
0 / 5 - 0 ratings