Skip to content
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

ebizmarts_ecommerce job unchecks "Use Default Value" checkbox for some product attributes #1758

Closed
PachisPachis opened this issue Aug 3, 2023 · 1 comment · Fixed by #1767, #1768, #1769, #1770 or #1771

Comments

@PachisPachis
Copy link

PachisPachis commented Aug 3, 2023

Preconditions

Magento 2.4.6-p1
mc-magento2 v103.4.53
One store view with Id=1

Steps to reproduce

Create new simple product with basic data
Select "Default Store View" scope, you will notice that all "Use Default Value" checkboxes are checked. This is the desired and factory behaviour for Magento.
Run ebizmarts_ecommerce cron job

Actual result

After running the cron job, you will notice that the checkbox "Use Default Value" is now unchecked for some attributes like Product Name, Tax Class, Visibility, etc...
This is totally unexpected and generates a problem because from this moment you will have two values for the same attribute, one for the global scope, another one for the store view with id=1. If you usually update products in global scope (programmatiacally like us), you won't notice that there are subyacent values in store view scope.

Expected result

The module shouldn't modify my product data in any way, even less without warning the user.

@DarthFly
Copy link

The culprit here seems to be this commit - e3a1089
The code

    $product = $this->productFactory->create()->load($entityId);
...
    $product->save();

saves product on the currently assumed scope (main cron file sets it), updates attributes, runs a lot of unnecessary things to just trigger some Before/After observers that seem like do nothing in this case.
Just comment the whole part of from creating product and saving it, I don't see any benefits from it.

gonzaloebiz added a commit that referenced this issue Aug 16, 2023
@gonzaloebiz gonzaloebiz self-assigned this Aug 16, 2023
@gonzaloebiz gonzaloebiz added this to the 10x.x.54 milestone Aug 16, 2023
gonzaloebiz added a commit that referenced this issue Aug 16, 2023
gonzaloebiz added a commit that referenced this issue Aug 16, 2023
gonzaloebiz added a commit that referenced this issue Aug 16, 2023
gonzaloebiz added a commit that referenced this issue Aug 16, 2023
gonzaloebiz added a commit that referenced this issue Aug 17, 2023
gonzaloebiz added a commit that referenced this issue Aug 17, 2023
gonzaloebiz added a commit that referenced this issue Aug 17, 2023
gonzaloebiz added a commit that referenced this issue Aug 17, 2023
gonzaloebiz added a commit that referenced this issue Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment