-
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
Bug fix for #21753 (2.3-develop) #22073
Bug fix for #21753 (2.3-develop) #22073
Conversation
…nloadable\Model\Link\Purchased\Item::XML_PATH_ORDER_ITEM_STATUS is set to 'Pending' (magento#21753)
Hi @crankycyclops. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
app/code/Magento/Downloadable/Observer/SaveDownloadableOrderItemObserver.php
Outdated
Show resolved
Hide resolved
@@ -150,6 +155,8 @@ public function execute(\Magento\Framework\Event\Observer $observer) | |||
)->setNumberOfDownloadsBought( | |||
$numberOfDownloads | |||
)->setStatus( | |||
1 == $statusToEnable ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, get value from \Magento\Sales\Model\Order\Item::STATUS_PENDING
instead of hardcoded ('1') value and use the strict comparison operator ===
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I implemented all of the requested changes except for the strict comparison. If you var_dump the constant and the value returned from the admin setting, you can see that the constant is an integer while the admin setting value is a string.
Hi @crankycyclops. Thank you for your collaboration. Please, check the review for minor adjustments. |
Great, thank you. Looks like we also need a minor adjustment to the failing unit test |
Should be fixed now :) |
Hi @rogyar, thank you for the review. |
@crankycyclops thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
✔️ QA passed |
@crankycyclops can you update it, please? |
@sashas777 You mean merge the current 2.3-develop branch into it, right? |
@crankycyclops |
Done. Should be good now :) |
Hi @crankycyclops, thank you for your contribution! |
Description (*)
Fixes the issue raised in #21753 by setting the initial downloadable item status to Available if \Magento\Downloadable\Model\Link\Purchased\Item::XML_PATH_ORDER_ITEM_STATUS is set to 'Pending.'
Fixed Issues (if relevant)
Manual testing scenarios (*)
Contribution checklist (*)