2

I have a quite simple piece of code (reduced it to that):

try {
    $newProduct = $this->productRepository->get($productData['sku']);
    echo 'Loaded.' . PHP_EOL;
    $savedProduct = $this->productRepository->save($newProduct);
} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
    echo 'Saving failed; product does not exist. ' . $e->getMessage() . PHP_EOL;
    // $newProduct = $this->productInterfaceFactory->create();
} catch (\Exception $e) {
    echo 'Just some other problem: ' . $e->getMessage() . PHP_EOL;
}

and it outputs this:

Loaded.
Just some other problem: Invalid method Magento\Eav\Model\Entity\Attribute::isScopeGlobal

... I have no clue why this could happen. Any ideas?

1
  • Did you found the solution? I'm experiencing the same problem Jun 20, 2018 at 12:49

1 Answer 1

1

It took us some ours of investigation... But we finally found the cause:

Integer attributes of products were not saved at all, while all other attributes were properly propagated. Why? - Someone had changed the value_id column of our catalog_product_entity_int table to BIGINT via a setup script, but forgotten to explicitly set the auto_increment attribute:

auto increment value missing

To fix it, I added the auto increment attribute to the _auto_increment_ column:

enter image description here

I think, there might be many other causes for this error message; but this was it for us here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.