Skip to content

illegal string offset 'is_in_stock' when attempting to modify product imported from M2ePro. #6797

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
djfordz opened this issue Sep 28, 2016 · 6 comments

Comments

@djfordz
Copy link

djfordz commented Sep 28, 2016

Preconditions

  1. CentOS6
  2. Percona Server 5.6
  3. PHP 7.0
  4. Magento 2.1.1

Steps to reproduce

  1. import products via M2EPro
  2. Attempt to edit product in Product->Catalog

Expected result

  1. form should appear to edit product

Actual result

  1. [Screenshot, logs]
    illegal string offset in app/code/Magento/CatalogInventory/Ui/DataProvider/Product/Form/Modifier/AdvancedInventory.php on line 88.

Logged code at location:
is not an array but a value.

To Fix:

changed this line in code:
if (isset($stockData['is_in_stock'])) {
        $data[$modelId][self::DATA_SOURCE_DEFAULT][$fieldCode]['is_in_stock'] =
        (int)$stockData['is_in_stock'];
    }

to

if (isset($stockData['is_in_stock'])) {
        $data[$modelId][self::DATA_SOURCE_DEFAULT]['is_in_stock'] =
        (int)$stockData['is_in_stock'];
    }

array went one too deep.

CentOS6, Percona Server 5.6, Magento 2.1.1

@veloraven
Copy link
Contributor

@djfordz thank you for your feedback.
Could you please explain why do you think this to be Magento issue and not an issue of the extension's import?

@djfordz
Copy link
Author

djfordz commented Oct 13, 2016

Are you saying the product could possibly be imported incorrectly? I will have to look into this, as I just assumed since the product was already imported and disconnected from M2ePro, that it was a Magento issue, however my assumptions do seem to get me in trouble lately. I'll troubleshoot this issue further and give you an update.

@lhsatch
Copy link

lhsatch commented Oct 21, 2016

Can you post your addtocart.phtml file (module-catalog\view\frontend\templates\product\view\addtocart.phtml) or if your module is using a different addtocart file can you upload that.

@veloraven
Copy link
Contributor

@djfordz is there any update?
Is this issue still actual?

@djfordz
Copy link
Author

djfordz commented Oct 28, 2016

You can close, I've been sick for over a week and have not had time to do any research, I've fixed the issue for the customer, I am just now getting back to work, most likely an M2Epro deal anyways if no one else is having issue. Thank you.

@veloraven
Copy link
Contributor

@djfordz thank you for update.
If you face this issue again and have some proofs that this is Magento's issue, feel free to create the new GitHub issue.

magento-engcom-team pushed a commit that referenced this issue May 4, 2021
MC-40624: Add Adobe DAM (Digital Asset Manager) to Admin Panel CSP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants