-
Notifications
You must be signed in to change notification settings - Fork 9.4k
REST API: Product updates with wrong store_id #7612
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
Comments
@tdittmar thank you for your feedback. |
@veloraven I updated the original bug report. |
By the way: The same problem occurs also when fetching product information from Magento with a GET request to Only if I delete the wrongly inserted attributes from the database manually I get the expected values that were passed to Magento when creating the item. |
Hi, thank you for your report. Internal ticket MAGETWO-61834 was created |
The problem (with saving, anyway) is that there's no way to configure which store scope to use with the current API code. Line 513 of \Magento\Catalog\Model\ProductRepository in save(): Magento always just gets the current frontend store_id when saving the product data. There's no way to pass in the desired store - or to set the global store data. |
So why is it different for create (POST) and update (PUT)? If it just used
the same id every time...
Am 07.12.2016 7:54 nachm. schrieb "Jeremy Rimpo" <[email protected]>:
… The problem (with saving, anyway) is that there's no way to configure
which store scope to use with the current API code.
Line 513 of \Magento\Catalog\Model\ProductRepository in save():
$productDataArray['store_id'] = (int)$this->storeManager->
getStore()->getId();
Magento always just gets the default frontend store_id when saving the
product data. There's no way to pass in the desired store.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7612 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AD05zF9eXt57hwPSKSP9nYTdbujomk7aks5rFwDGgaJpZM4K_DZc>
.
|
Not completely clear. Both methods resolve to the same save() function, but there are slightly different methods called if it's a new product. (Both methods can update existing products, and POST has the same issue when updating products.) Perhaps the data for a new product is just being saved globally instead of for a specific scope, which could be a different bug in itself. Most likely this could be because there has to be data for the global scope so new data gets saved there while updated data may write to a store-specific scope if the store_id is set. |
I'm closing this issue as internal ticket was closed as not a bug.
|
Still a problem in Magento 2.2, 2.3. |
CABPI-4: IMS identity | Adobe Commerce Core Admin Panel
Preconditions
Steps to reproduce
/rest/V1/products
) with descriptions and META information.catalog_product_entity_text
) that the attributes are inserted withstore_id
0/rest/V1/products/{sku}
).store_id
1 instead of updating the previously created attribute.Expected result
store_id
.Actual result
store_id
1.This is for Magento version 2.1.2 and was not an issue in pre-2.1 versions.
The text was updated successfully, but these errors were encountered: