[Forwardport] 9830 - Null order in Magento\Sales\Block\Order\PrintShipment.php #18272
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Original Pull Request
#17998
DESCRIPTION
When trying to print the order information from customer's account view the following error is placed in httpd logs:
Fatal error: Call to a member function getRealOrderId() on null in /vendor/magento/module-sales/Block/Order/PrintShipment.php
The cause of this was additional AJAX request taking place after closing the print prompt as discussed by @ihor-sviziev in #9830, trying to render print information one additional time, however without registry properly initialized, it results in the error. I've changed the block that was causing this issue to be uncachable, which seems to be fixing the problem. I've also added changes that were added to 2.1 from #10530 that were not present in 2.2.
FIXED ISSUES
MANUAL TESTING SCENARIOS