Created
September 16, 2022 15:05
-
-
Save junaidpv/e7715e4d63062c184571d31af69b5685 to your computer and use it in GitHub Desktop.
Patch for the commerce_migrate to fIx migraiton error when there is not order component present.
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
| diff --git a/modules/commerce/src/Plugin/migrate/process/commerce1/OrderItemDiscountAdjustment.php b/modules/commerce/src/Plugin/migrate/process/commerce1/OrderItemDiscountAdjustment.php | |
| index 3ece971..45fb789 100644 | |
| --- a/modules/commerce/src/Plugin/migrate/process/commerce1/OrderItemDiscountAdjustment.php | |
| +++ b/modules/commerce/src/Plugin/migrate/process/commerce1/OrderItemDiscountAdjustment.php | |
| @@ -116,7 +116,7 @@ class OrderItemDiscountAdjustment extends CommercePrice implements ContainerFact | |
| // Find all price components on the order, not the line item, that are not | |
| // a shipping type and not also in the line item price components. | |
| - $order_components = $row->getSourceProperty('order_components/0/data/components'); | |
| + $order_components = $row->getSourceProperty('order_components/0/data/components') ?? []; | |
| $order_names = []; | |
| foreach ($order_components as $order_component) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment