Skip to content

Magento BundleProduct Error #10497

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
riyuk opened this issue Aug 11, 2017 · 8 comments
Closed

Magento BundleProduct Error #10497

riyuk opened this issue Aug 11, 2017 · 8 comments
Assignees
Labels
bug report Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update

Comments

@riyuk
Copy link

riyuk commented Aug 11, 2017

Preconditions

  1. Magento 2.1.7
  2. PHP 7

Steps to reproduce

  1. Setup a BundleProduct
  2. Assign ~35 Options with about 45 Products for each Option
  3. Close the Product
  4. Create another Attribute-Set with more Custom Options
  5. Open up the Product and try to assign it to the new Attribute-Set and press save

Expected result

  1. Save Product as Expected

Actual result

  1. Warning: Illegal string offset 'is_delete' in /vendor/magento/module-bundle/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Bundle.php on line 197
  2. Notice: Undefined index: delete in /vendor/magento/module-bundle/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Bundle.php on line 130
  3. Warning: Illegal string offset 'is_delete' in /vendor/magento/module-bundle/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Bundle.php on line 200

I fixed this on Core with:

if( !isset( $customOptions[$key] ) || !is_array( $customOptions[$key] ) ) {
    $customOptions[$key] = [];
}

right before:

# Line 197
$customOptions[$key]['is_delete'] = 1;

if (isset($optionData['delete']) && (bool)$optionData['delete']) {

On Line 130:

# Line 130 before
if ((bool)$optionData['delete']) {

if (isset($customOptionData['is_delete']) && (bool)$customOptionData['is_delete']) {

On Line 200:

# Line 200 before
if ((bool)$customOptionData['is_delete']) {

It would be great, if magento2 does some validation on arrays before trying to access them.
There were a lot of errors like this before, which can easily prevented by doing some validation first...

@orlangur
Copy link
Contributor

There were a lot of errors like this before, which can easily prevented by doing some validation first...

Not really, it would bloat the code and does not affect shop workability anyway.

Assign ~35 Options with about 45 Products for each Option

Does not look like an isolated test case to me. Did you find the reason why delete and is_delete indexes are absent?

@riyuk
Copy link
Author

riyuk commented Aug 11, 2017

I really don't know. We've not installed any extensions on magento.
This error "just occured". I can't tell you why since I don't know what the Support/Plugin does on Controller/Adminhtml/Product/Initialization/Helper/Plugin/Bundle.php.

What I just discovered is that we created a ticket a long time ago for (maybe) the exact same reason.

@robertkent
Copy link

robertkent commented Aug 29, 2017

I can confirm this is a problem in 2.1.8 - it essentially happens if the Bundle Items goes onto different pages using it's own pagination in the edit product page. Seems to be after 39 options if that helps.

@magento-engcom-team magento-engcom-team added G1 Passed bug report Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed G1 Passed labels Sep 5, 2017
@magento-engcom-team magento-engcom-team added the Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed label Sep 15, 2017
@magento-engcom-team
Copy link
Contributor

magento-engcom-team commented Sep 19, 2017

@riyuk thank you for your report.
We were not able to reproduce this issue by following the steps you provided.
Please provide more details. And can You please clarify step 4? What do You mean by "Create another Attribute-Set with more Custom Options"?

@magento-engcom-team magento-engcom-team self-assigned this Sep 19, 2017
@magento-engcom-team magento-engcom-team added the Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch label Sep 20, 2017
@magento-engcom-team
Copy link
Contributor

@riyuk, we are closing this issue due to inactivity. If you'd like to update it, please reopen the issue.

@allisonlawrencels
Copy link

I reported this issue to the Magento team as well, for 2.2.1 and I am still seeing it in 2.2.3, but they were not able to reproduce. Has anyone had any luck with this?

Magento team, what other information would you suggest we provide to help you reproduce the bug?

@riyuk
Copy link
Author

riyuk commented Apr 2, 2019

Magento Error

The error still exists in Magento 2.3.0.
We got a Bundleproduct with 23 Options. These Options are Select Fields with up to 40 different virtual Products.

@orlangur
Copy link
Contributor

orlangur commented Apr 2, 2019

This could be related to environment configuration, for example https://www.php.net/manual/en/info.configuration.php#ini.max-input-vars

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update
Projects
None yet
Development

No branches or pull requests

6 participants