Closed (fixed)
Project:
Commerce Shipping
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
19 Feb 2017 at 21:53 UTC
Updated:
17 Jul 2017 at 23:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jsacksick commentedI decided to give it a shot, I flag the shipment (I set _updated to TRUE) if a change has been detected.
However, I detected an issue while doing some tests locally, the test I'm relying on for detecting a change will always return TRUE because the default packer will return a list of proposed shipments that don't have the "package_type_id" property set.
Comment #3
jsacksick commentedSince the package type is populated in preSave, the package type set in
populateFromProposedShipmentwas always set to NULL causing the comparison to fail...As a temporary fix, I don't update the package type if empty.
Comment #4
googletorp commentedI believe ::hasTranslationChanges should give us what we need. It detects changes for a specific translation which is basically what we want to test.
Comment #5
bojanz commentedInteresting, didn't know about this method.
We need a test to prove that it works as promised (especially since Jonathan mentioned that package_type is kinda special)
Comment #6
googletorp commentedI was hoping we already would have a test for this, I need to dig into the module a bit more to really get a bearing of it again.
@bojanz Maybe we can hook up on IRC and talk about how to make the test, I'm still a bit fussy for some the architecture.
Comment #8
bojanz commentedDecided to proceed without tests, since we're using a core function here (and we've successfully used it in Profile since then)