[Forwardport] Update shipment collection to unserialize packages attribute after load#18231
Merged
magento-engcom-team merged 1 commit intomagento:2.3-developfrom Oct 3, 2018
mage2pratik:2.3-develop-PR-port-17679
Merged
[Forwardport] Update shipment collection to unserialize packages attribute after load#18231magento-engcom-team merged 1 commit intomagento:2.3-developfrom mage2pratik:2.3-develop-PR-port-17679
packages attribute after load#18231magento-engcom-team merged 1 commit intomagento:2.3-developfrom
mage2pratik:2.3-develop-PR-port-17679
Conversation
Contributor
|
Hi @mage2pratik. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
sidolov
approved these changes
Sep 25, 2018
Contributor
|
Hi @sidolov, thank you for the review. |
magento-engcom-team
pushed a commit
that referenced
this pull request
Oct 3, 2018
…`packages` attribute after load #18231
Contributor
|
Hi @mage2pratik. Thank you for your contribution. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
#17679
Description
The column
packagesinsales_shipmentis in its resource model\Magento\Sales\Model\ResourceModel\Order\Shipmentcharacterized as a serializable field. Butpackagesdoesn't get unserialized when shipments are loaded with a collection. This pull request fixes the issue by unserializing the field after the collection is loaded.Manual testing scenarios
packagesis in my case set to[].packagesis a string, but should be an array.In this example the same shipment is loaded with 1.) the shipment repository and 2.) the shipment collection. The output is:
This consequently causes further problems if the shipment loaded with the shipment collection is being updated, because
packagesgets saved as"[]"(the quotation marks are now a part of the string).packagesnow can't get unserialized when it's loaded with any method. Also an error is shown if this shipment is opened in the backend because an array is expected but a string is given:Contribution checklist