Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save junaidpv/29669a025e7d6dace7798f855933debc to your computer and use it in GitHub Desktop.
Save junaidpv/29669a025e7d6dace7798f855933debc to your computer and use it in GitHub Desktop.
Patch for field group module to fix error with migrating fied group on commerce order
diff --git a/contrib/field_group_migrate/src/Plugin/migrate/destination/d7/FieldGroup.php b/contrib/field_group_migrate/src/Plugin/migrate/destination/d7/FieldGroup.php
index 35266ae..657573d 100644
--- a/contrib/field_group_migrate/src/Plugin/migrate/destination/d7/FieldGroup.php
+++ b/contrib/field_group_migrate/src/Plugin/migrate/destination/d7/FieldGroup.php
@@ -26,6 +26,11 @@ class FieldGroup extends DestinationBase {
$values[$id] = $row->getDestinationProperty($id);
}
+ // Fix commerce_order bundle, there is no only one order type.
+ if ('commerce_order' == $values['entity_type']) {
+ $values['bundle'] = 'default';
+ }
+
$entity = $this->getEntity($values['entity_type'], $values['bundle'], $values['mode'], $values['type']);
$settings = $row->getDestinationProperty('settings');
$settings += [
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment