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 when trying to recover order info from quote that doesn't exist #38

Closed
cykirsch opened this issue Jan 23, 2018 · 6 comments
Closed

Comments

@cykirsch
Copy link

I've migrated my data from Magento 1.7 using data migration tool. The Magento 1 site only had ShipperHQ for maybe the last 10% of orders. When I load a Pre-ShipperHQ order in the admin I get an exception

#0 /Users/me/Projects/mysite/www/vendor/magento/module-quote/Model/QuoteRepository.php(217): Magento\Framework\Exception\NoSuchEntityException::singleField('cartId', '2256495')
#1 /Users/me/Projects/mysite/www/vendor/magento/module-quote/Model/QuoteRepository.php(121): Magento\Quote\Model\QuoteRepository->loadQuote('loadByIdWithout...', 'cartId', '2256495', Array)
#2 /Users/me/Projects/mysite/www/generated/code/Magento/Quote/Model/QuoteRepository/Interceptor.php(24): Magento\Quote\Model\QuoteRepository->get('2256495', Array)
#3 /Users/me/Projects/mysite/www/vendor/shipperhq/module-shipper/src/Helper/CarrierGroup.php(291): Magento\Quote\Model\QuoteRepository\Interceptor->get('2256495')
#4 /Users/me/Projects/mysite/www/vendor/shipperhq/module-shipper/src/Helper/CarrierGroup.php(296): ShipperHQ\Shipper\Helper\CarrierGroup->getQuoteShippingAddressFromOrder(Object(Magento\Sales\Model\Order\Interceptor))
#5 /Users/me/Projects/mysite/www/vendor/shipperhq/module-shipper/src/Block/Adminhtml/Order/View/Info.php(116): ShipperHQ\Shipper\Helper\CarrierGroup->recoverOrderInfoFromQuote(Object(Magento\Sales\Model\Order\Interceptor))
#6 /Users/me/Projects/mysite/www/vendor/shipperhq/module-shipper/src/Block/Adminhtml/Order/View/Info.php(144): ShipperHQ\Shipper\Block\Adminhtml\Order\View\Info->getCarriergroupInfo()
#7 /Users/me/Projects/mysite/www/vendor/shipperhq/module-shipper/src/Block/Adminhtml/Order/View/Info.php(94): ShipperHQ\Shipper\Block\Adminhtml\Order\View\Info->getFieldValue('carrier_group_d...')
#8 [internal function]: ShipperHQ\Shipper\Block\Adminhtml\Order\View\Info->getCarrierGroupBreakdownText()
#9 /Users/me/Projects/mysite/www/vendor/magento/framework/View/TemplateEngine/Php.php(82): call_user_func_array(Array, Array)
#10 /Users/me/Projects/mysite/www/vendor/shipperhq/module-shipper/src/view/adminhtml/templates/order/view/shq_info.phtml(10): Magento\Framework\View\TemplateEngine\Php->__call('getCarrierGroup...', Array)
...

If I comment out the lines

        $shippingAddress = $this->getQuoteShippingAddressFromOrder($order);
        $this->saveOrderDetail($order, $shippingAddress);

in the method ShipperHQ\Shipper\Helper\CarrierGroup::recoverOrderInfoFromQuote, then the page loads and adds the "No detailed shipping information recorded" comment.

@wsajosh
Copy link
Contributor

wsajosh commented Jan 24, 2018

Hey @cykirsch , thanks for raising this with us! So it looks like the migration tool hasn't copied over the quote that corresponds with that order. Are you able to check the quote table please and let us know if that's the case?

@cykirsch
Copy link
Author

Our Magento 1 database does not have quotes for all history. In fact I think it is quite common to remove quotes several days after they have been converted to orders. https://magento.stackexchange.com/questions/92121/quote-item-is-missing-but-the-order-exists

So yes, it is true the migration tool did not copy over the quote, but it is because it does not exist. And this is true for hundreds of thousands of orders.

@wsajosh
Copy link
Contributor

wsajosh commented Jan 26, 2018

Thanks for confirming. It's definitely common practice to remove them after several days, I wanted to ensure that we were on the right track before digging into the issue. I'm going to have the team here look into this and will provide a update next week on the status of the issue. Thanks for raising and providing the extra information!

@wsajosh
Copy link
Contributor

wsajosh commented Feb 1, 2018

@cykirsch Thanks for raising this. We've implemented a fix. It will be available by the end of today.

@wsajosh wsajosh closed this as completed Feb 1, 2018
@wsajosh
Copy link
Contributor

wsajosh commented Feb 1, 2018

@cykirsch Just to let you know, we've postponed the update until tomorrow. It will be released as part of a larger update. Thanks for your patience!

@cykirsch
Copy link
Author

cykirsch commented Feb 1, 2018

Cool, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants