Problem
If you run the Line Item Migration more than once (say you're doing an update, or some value was missed for example), the line item entity is added twice to the same order and throws off the order total.
Reason
CommerceMigrateUbercartLineItem::complete() has code that will blindly attach the line item to its order. This is needed the first time through, but after that it's a problem.
Solution
Check to see if that line item has already been attached to its order. If so, skip the rest of the complete() function.
Patch
Patch attached will loop through existing line item values on an order and if it finds a match will bail out of complete(). Improvements are welcome, I don't know if there's an easier way to interact with the commerce_line_items array than using the getIterator().
| Comment | File | Size | Author |
|---|---|---|---|
| commerce-migrate-ubercart-update-line-items-0.patch | 875 bytes | kscheirer |
Comments
Comment #1
kscheirerComment #2
dwkitchen commented