-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Product Repository saves attribute values for existing product always on "Default Store Level" #7720
Comments
This is driving me crazy. Updating a product in the backend always saves attributes with store_id of 0 and then on the frontend it looks up attributes using store_id of 1. So the only way to update anything is to do so directly in the database. This is with single store mode enabled, which should mean that there should only be ONE store not two. |
I have this issue as well. I fixed it with a hack but is something going to be done about this? |
I can confirm that this is an issue for me too still. Magento 2.1.6 |
What kind of hack did you use? This is really a debilitating issue and the
developers don't seem to care at all.
- Matt
…On Mar 27, 2017 2:24 PM, "leitot" ***@***.***> wrote:
I have this issue as well. I fixed it with a hack but is something going
to be done about this?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#7720 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAUf75koyoYhVYhjfucIs3xidcrCeJxHks5rp_uNgaJpZM4LHJ7x>
.
|
I wrote a before plugin for the save() method for the type Magento\Catalog\Model\ResourceModel\Product. Inside beforeSave() I set the store ID correctly on the product (after the ProductRepository's save() method messes it up) |
Thanks, I'll give that a shot. I have the same problem with the category
repository too.
- Matt
On May 22, 2017 9:03 PM, "leitot" <notifications@github.com> wrote:
I wrote a before plugin for the save() method for the type
Magento\Catalog\Model\ResourceModel\Product. Inside beforeSave() I set the
store ID correctly on the product (after the ProductRepository's save()
method messes it up)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#7720 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAUf75oBD3hoHTgjSLK6Qrr9hU7PmiZoks5r8j5bgaJpZM4LHJ7x>
.
|
I have this issue in CE 2.1.7. The save method in the ProductRepository is incorrectly setting the store_id property on the product. The fix is to check if the store_id is already set on the product, and if not, set it. Add the if-statement around the line below:
|
@itaymesh, thank you for your report. |
✅ Confirmed by @engcom-Charlie Issue Available: @engcom-Charlie, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
Hi @engcom-Charlie. Thank you for working on this issue.
|
Hi @itaymesh. Thank you for your report.
The fix will be available with the upcoming 2.4.2 release. |
B2B-2248: WebAPIAsync missing store information when db queue is used
Preconditions
Steps to reproduce
Expected result
Actual result
Seems like the product repository class overrides the product store id and always assign default store id
app/code/Magento/Catalog/Model/ProductRepository.php#L530
$productDataArray['store_id'] = (int)$this->storeManager->getStore()->getId();
The only way to work around this issue is by getting the existing product with explicit parameter:
$product = $this->_productRepository->get($sku, true, 0);
and use the deprecated save method of Magento\Framework\Model\AbstractModel class at line 629.
The text was updated successfully, but these errors were encountered: