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

Get Shipping Method as object from order instance gives undefined index. #20380

Closed
mahesh-rajawat opened this issue Jan 17, 2019 · 5 comments
Closed
Assignees
Labels
Component: Sales Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@mahesh-rajawat
Copy link
Member

Preconditions (*)

  1. Magento 2.3.0
  2. Magento 2.2.x

Steps to reproduce (*)

  1. Create a downloadable or virtual product.
  2. Place an order with this product.
  3. In custom controller or anywhere load order with id.
    $order = $this->orderFactory->create()->load($orderId); //your order id
  4. Now get shipping method as object.
    $order->getShippingMethod(true)->getMethod();
  5. It gives below error
    Notice: Undefined offset: 1 in /Users/mahesh/contribute/mage226/vendor/magento/module-sales/Model/Order.php on line 1223

Expected result (*)

  1. It should return Null if order has no shipping method, so developers can manage it from their end.

Actual result (*)

screenshot

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Jan 17, 2019
@magento-engcom-team
Copy link
Contributor

Hi @maheshWebkul721. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me $VERSION instance

where $VERSION is version tags (starting from 2.2.0+) or develop branches (for example: 2.3-develop).
For more details, please, review the Magento Contributor Assistant documentation.

@maheshWebkul721 do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@mahesh-rajawat mahesh-rajawat self-assigned this Jan 17, 2019
@mahesh-rajawat mahesh-rajawat added Component: Sales Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Jan 17, 2019
@magento-engcom-team
Copy link
Contributor

@maheshWebkul721 Thank you for verifying the issue. Based on the provided information internal tickets MAGETWO-97697, MAGETWO-97698 were created

@magento-engcom-team magento-engcom-team added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Jan 17, 2019
@ghost ghost assigned ghost and unassigned mahesh-rajawat Jan 18, 2019
@magento-engcom-team
Copy link
Contributor

Hi @engcom-backlog-nazar. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if your want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 3. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 4. If the issue is not relevant or is not reproducible any more, feel free to close it.

@ghost ghost removed their assignment Jan 18, 2019
@mahesh-rajawat mahesh-rajawat self-assigned this Jan 21, 2019
mahesh-rajawat added a commit to mahesh-rajawat/magento2 that referenced this issue Jan 31, 2019
@magento-engcom-team
Copy link
Contributor

Hi @maheshWebkul721. Thank you for your report.
The issue has been fixed in #20381 by @maheshWebkul721 in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Feb 13, 2019
@magento-engcom-team
Copy link
Contributor

Hi @maheshWebkul721. Thank you for your report.
The issue has been fixed in #20866 by @maheshWebkul721 in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.9 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Feb 25, 2019
magento-engcom-team added a commit that referenced this issue Feb 25, 2019
 - Merge Pull Request #20866 from maheshWebkul721/magento2:fixed-20380-2.2
 - Merged commits:
   1. c495f31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Sales Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

2 participants