Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save junaidpv/4830a495e9435904967f430972beddad to your computer and use it in GitHub Desktop.
Save junaidpv/4830a495e9435904967f430972beddad to your computer and use it in GitHub Desktop.
Patch to help migrate entityrefence field referring profile2 entities in D7 to profile entities in D9. This is prepared for BWMA migration from D7 to D9. Most probably needed for any other sites. Thus can be remoced once the BWMA migration is complete.
diff --git a/core/modules/field/src/Plugin/migrate/process/d7/FieldSettings.php b/core/modules/field/src/Plugin/migrate/process/d7/FieldSettings.php
index a18e4fac99..e35163b284 100644
--- a/core/modules/field/src/Plugin/migrate/process/d7/FieldSettings.php
+++ b/core/modules/field/src/Plugin/migrate/process/d7/FieldSettings.php
@@ -44,6 +44,10 @@ public function transform($value, MigrateExecutableInterface $migrate_executable
case 'user_reference':
$value['target_type'] = 'user';
break;
+ case 'entityreference':
+ if ($value['target_type'] == 'profile2') {
+ $value['target_type'] = 'profile';
+ }
default:
break;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment