magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.54k stars 9.32k forks source link

MySQL Error on Product Save #36522

Closed soumiktuban closed 1 year ago

soumiktuban commented 1 year ago

Preconditions and environment

Steps to reproduce

  1. Admin -> Catalog -> Products -> Edit any Product (Which is associated with at least one website).
  2. Now Uncheck all websites from "Product in Websites".
  3. Change "Visibility" from Catalog Search to "Not Visible Individually".
  4. Save

Expected result

You saved the product.

Actual result

Getting an error, looks like store_id is not properly constructed:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 1, query was: DELETE url_rewrite FROM url_rewrite WHERE (entity_id IN ('1')) AND (entity_type IN ('product')) AND (store_id IN ())

Additional information

CoreIssue

Release note

No response

Triage and priority

m2-assistant[bot] commented 1 year ago

Hi @soumiktuban. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:

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:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: 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.

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] commented 1 year ago

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: :point_down:

engcom-Bravo commented 1 year ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 1 year ago

Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 1 year ago

Hi @engcom-Bravo, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.

engcom-Bravo commented 1 year ago

Hi @soumiktuban,

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

1.Admin -> Catalog -> Products -> Edit any Product (Which is associated with at least one website). 2.Now Uncheck all websites from "Product in Websites". 3.Change "Visibility" from Catalog Search to "Not Visible Individually". 4.Save

Screenshot 2022-11-24 at 1 15 34 PM Screenshot 2022-11-24 at 1 15 40 PM Screenshot 2022-11-24 at 1 15 56 PM

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

Thanks

soumiktuban commented 1 year ago

Hi @engcom-Bravo Can I have your instance to verify the issue and if I can reproduce it? Also, I have updated the PHP and MySQL versions on "Preconditions and environment", is it possible to verify on that version?

Also, I believe after saving if you have a single website then it automatically checked.

engcom-Bravo commented 1 year ago

Hi @soumiktuban,

Thanks for your update.

We have verified in our Local Instance Magento 2.4 develop and the issue is not reproducible.Kindly refer the screenshots.

Steps to reproduce

1.Admin -> Catalog -> Products -> Edit any Product (Which is associated with at least one website). 2.Now Uncheck all websites from "Product in Websites". 3.Change "Visibility" from Catalog Search to "Not Visible Individually". 4.Save

After saving the product there is no change in Product in Websites.

iugwdfuH-Products-Inventory-Catalog-Magento-Admin

Kindly check your System requirements.Magento 2.4.5 is supported for PHP 8.1.

https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html.

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

Thanks.

soumiktuban commented 1 year ago

Hi @engcom-Bravo

Currently, I am using PHP 8.1. Still, I am able to replicate the issue. Kindly re-check the issue. Screenshot attached.

image

image

Thanks

engcom-Bravo commented 1 year ago

Hi @soumiktuban.

Thanks for your update.

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

We are using PHP 8.1

Screenshot 2022-11-28 at 12 07 38 PM Screenshot 2022-11-28 at 12 47 33 PM

rbccgvbv-Products-Inventory-Catalog-Magento-Admin

Kindly recheck the issue on Magento 2.4-develop instance and check if any 3rd party extensions / modules enabled is causing this issue.

Thanks.

soumiktuban commented 1 year ago

Thanks for the response.

It looks like the below code changes fix the issue: https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php

image

Kindly let me know, what is the release version of the above code.

Thanks

engcom-Bravo commented 1 year ago

Hi @soumiktuban,

Thanks for your update.

we have verified in magento 2.4 develop branch.it is recommended to verify the issue on Magento 2.4-develop instance as it is an upcoming 2.4.x release and have latest code base.

Please let us know if you are still any issue.

Thanks.

soumiktuban commented 1 year ago

Hi @engcom-Bravo

Thanks for the information.

Kindly share the release version of the above code fix and the estimated time to release.

Thanks.

engcom-Bravo commented 1 year ago

Hello @soumiktuban,

As I can see this issue got fixed in the scope of the internal Jira ticket AC-2567 by the internal team. Related commits: https://github.com/magento/magento2/search?q=AC-2567&type=commits

Based on the Jira ticket, the target version is 2.4.6

Thanks.