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

Bug fix for #21753 (2.3-develop) #22073

Merged
merged 6 commits into from
Apr 16, 2019

Conversation

crankycyclops
Copy link
Contributor

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)

  1. Order Item Status to Enable Downloads is set to "Pending," but no download links are presented in "My Downloads" when logged in (fix provided) #21753

Manual testing scenarios (*)

  1. Login to the admin and set Stores -> Configuration -> Catalog -> Downloadable Product Options -> Order Item Status to Enable Downloads to "Pending"
  2. Create a downloadable product in the admin
  3. Create a user account on the frontend and login
  4. Purchase a downloadable product. The product should be placed in the "available" state after successful completion of payment.
  5. Login to the admin and set Stores -> Configuration -> Catalog -> Downloadable Product Options -> Order Item Status to Enable Downloads to "Invoiced"
  6. Purchase the product again and note the second ordered item is in the "pending" status.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

…nloadable\Model\Link\Purchased\Item::XML_PATH_ORDER_ITEM_STATUS is set to 'Pending' (magento#21753)
@m2-assistant
Copy link

m2-assistant bot commented Mar 31, 2019

Hi @crankycyclops. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@@ -150,6 +155,8 @@ public function execute(\Magento\Framework\Event\Observer $observer)
)->setNumberOfDownloadsBought(
$numberOfDownloads
)->setStatus(
1 == $statusToEnable ?
Copy link
Contributor

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 ===

Copy link
Contributor Author

@crankycyclops crankycyclops Mar 31, 2019

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.

@ghost ghost assigned rogyar Mar 31, 2019
@rogyar
Copy link
Contributor

rogyar commented Mar 31, 2019

Hi @crankycyclops. Thank you for your collaboration. Please, check the review for minor adjustments.

@rogyar
Copy link
Contributor

rogyar commented Apr 3, 2019

Great, thank you. Looks like we also need a minor adjustment to the failing unit test
https://travis-ci.org/magento/magento2/jobs/513882399

@crankycyclops
Copy link
Contributor Author

Great, thank you. Looks like we also need a minor adjustment to the failing unit test
https://travis-ci.org/magento/magento2/jobs/513882399

Should be fixed now :)

@magento-engcom-team
Copy link
Contributor

Hi @rogyar, thank you for the review.
ENGCOM-4685 has been created to process this Pull Request

@magento-engcom-team
Copy link
Contributor

@crankycyclops thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@VasylShvorak
Copy link
Contributor

✔️ QA passed

@sashas777
Copy link
Contributor

@crankycyclops can you update it, please?

@crankycyclops
Copy link
Contributor Author

@crankycyclops can you update it, please?

@sashas777 You mean merge the current 2.3-develop branch into it, right?

@p-bystritsky p-bystritsky self-assigned this Apr 12, 2019
@sashas777
Copy link
Contributor

@crankycyclops
Yes, that it can be merged. Otherwise, we won't get it in any release:D

@crankycyclops
Copy link
Contributor Author

@crankycyclops
Yes, that it can be merged. Otherwise, we won't get it in any release:D

Done. Should be good now :)

@m2-assistant
Copy link

m2-assistant bot commented Apr 16, 2019

Hi @crankycyclops, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@magento-engcom-team magento-engcom-team added this to the Release: 2.3.2 milestone Apr 16, 2019
eduard13 pushed a commit to eduard13/magento2 that referenced this pull request Apr 16, 2019
amol2jcommerce pushed a commit to amol2jcommerce/magento2 that referenced this pull request Apr 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants