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

Saving a product produces a "No such entity with id =" banner #37874

Closed
1 of 5 tasks
robertdeboer opened this issue Aug 11, 2023 · 5 comments
Closed
1 of 5 tasks

Saving a product produces a "No such entity with id =" banner #37874

robertdeboer opened this issue Aug 11, 2023 · 5 comments
Assignees
Labels
Issue: needs update Additional information is require, waiting for response Reported on 2.4.6-p2 Indicates original Magento version for the Issue report.

Comments

@robertdeboer
Copy link

Preconditions and environment

  • Magento 2.4.6-p2
  • Magento B2B module
  • Enable B2B Company in Store -> Configuration -> General -> B2B Features: Enable Company
  • Do NOT enable the B2B shared catalog
  • Do NOT create any shared catalogs
  • Do NOT assign any products to any shared catalog

Steps to reproduce

Create a new product or update an existing product

Expected result

The page refreshed and you see "You saved the product"

Actual result

The page refreshes and you see "You saved the product" and "No such entity with id ="

In addition, this introduction of an error means if you go back to the product able and select Add New, the form may not clear itself and will contain all the product data of the previous product you were editing.

Additional information

In tracking this issue, it comes from the Shared Catalog module, specifically Magento\SharedCatalog\Model\SharedCatalogInvalidation->checkSharedCatalogExist().

This is becuase at Magento\SharedCatalog\Observer\Controller\SaveProduct->execute() it is calling Magento\SharedCatalog\Model\ProductManagement->assignProducts() with an empty string.

In the observer, at line 77, I see this:

         $forCreate = array_diff($sharedCatalogIds, $assignedSharedCatalogIds);
         foreach ($forCreate as $sharedCatalogId) {
            $this->productSharedCatalogManagement->assignProducts($sharedCatalogId, [$product]);
         }

The array_diff is returning an array with a single empty string and that is then being passed in the foreach and then in the function call.

I was able to patch this locally by:

         $forCreate = array_diff($sharedCatalogIds, $assignedSharedCatalogIds);
         foreach ($forCreate as $sharedCatalogId) {
-            $this->productSharedCatalogManagement->assignProducts($sharedCatalogId, [$product]);
+            if(!empty($sharedCatalogId)) {
+                $this->productSharedCatalogManagement->assignProducts($sharedCatalogId, [$product]);
+            }
         }

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
@m2-assistant
Copy link

m2-assistant bot commented Aug 11, 2023

Hi @robertdeboer. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

@m2-assistant
Copy link

m2-assistant bot commented Aug 12, 2023

Hi @engcom-Bravo. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Bravo engcom-Bravo added the Reported on 2.4.6-p2 Indicates original Magento version for the Issue report. label Aug 12, 2023
@engcom-Bravo
Copy link
Contributor

Hi @robertdeboer,

Thank you for reporting and collaboration.

Verified the issue on Magento 2.4-develop instance and the issue is not reproducible.Kindly refer the screenshots.

Steps to reproduce

  • Create a new product or update an existing product

We are able to create new product and able to update the existing product.

Screenshot 2023-08-14 at 12 15 23 PM
75a76f3d-ac24-453b-a43d-fd3c6f7b4337.mp4

Kindly recheck the behaviour on Magento 2.4-develop instance and elaborate steps to reproduce if the issue is still reproducible.

Thanks.

@engcom-Bravo engcom-Bravo added the Issue: needs update Additional information is require, waiting for response label Aug 14, 2023
@engcom-Bravo
Copy link
Contributor

Hi @robertdeboer,

Kindly provide latest update on this comment #37874 (comment) still you are working on this issue if you are able to reproduce the issue please elaborate the steps to reproduce.Please let us know still if you are facing any issue.

Thanks.

@engcom-Bravo
Copy link
Contributor

Hi @robertdeboer,

We have noticed that this issue has not been updated since long time.
Hence we assume that this issue is fixed now, so we are closing it. Please feel to raise a fresh ticket or reopen this ticket if you need more assistance on this.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: needs update Additional information is require, waiting for response Reported on 2.4.6-p2 Indicates original Magento version for the Issue report.
Projects
None yet
Development

No branches or pull requests

2 participants