-
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
Reorder with a deleted parent configurable product #39568
Comments
Hi @dmanners. Thank you for your report.
Join Magento Community Engineering Slack and ask your questions in #github channel. |
Hi @engcom-Bravo. Thank you for working on this issue.
|
Hi @dmanners, Thanks for your reporting and collaboration. We have tried to reproduce the issue in Latest 2.4-develop instance and we are not able to reproduce the issue.Kindly refer the screenshots. A message is shown to the user This product is no longer available.. Kindly recheck the issue in Latest 2.4-develop instance and elaborate the steps to reproduce if the issue is still reproducible. Thanks. |
Yeah I have confirmed it is still an issue on a locally checked out version of 2.4-develop when you delete not the ordered simple product but the top level configurable product as the code in https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/ConfigurableProductSales/Model/Order/Reorder/OrderedProductAvailabilityChecker.php#L61 tries to look up the parent product but throws an exception that is never caught. |
Hi @dmanners, Thanks for your update. We have tried to reproduce the issue in Latest 2.4-develop instance and we are able to reproduce the issue.Kindly refer the screenshots. An uncaught exception cause the website to break. Hence Confirming the issue. Thanks. |
✅ Jira issue https://jira.corp.adobe.com/browse/AC-13839 is successfully created for this GitHub issue. |
✅ Confirmed by @engcom-Bravo. Thank you for verifying the issue. |
Preconditions and environment
Steps to reproduce
Expected result
A message is shown to the user and the order is not placed.
Actual result
An uncaught exception cause the website to break.
Additional information
This happens because of the method
\Magento\ConfigurableProductSales\Model\Order\Reorder\OrderedProductAvailabilityChecker::isAvailable
.Here the following will cause an uncaught exception.
$parentItem = $this->productRepository->getById($item->getParentItem()->getProductId());
To fix this we have created an around plugin that first performs a try-catch on the getById and when something is caught then we simply return false, otherwise we continue onto the main method.
Release note
No response
Triage and priority
The text was updated successfully, but these errors were encountered: