Skip to content

Instantly share code, notes, and snippets.

@junaidpv
Created July 18, 2024 20:23
Show Gist options
  • Save junaidpv/87ddd535057337d37e11efa30e95dc7e to your computer and use it in GitHub Desktop.
Save junaidpv/87ddd535057337d37e11efa30e95dc7e to your computer and use it in GitHub Desktop.
Custom patch to help in BWMA migration from D7 to D9. To be removed once the migraiton is over
--- a/src/Plugin/migrate/process/AddressField.php
+++ a/src/Plugin/migrate/process/AddressField.php
@@ -19,6 +19,9 @@
* {@inheritdoc}
*/
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
+ if (empty($value)) {
+ return [];
+ }
$parsed = [
'country_code' => $value['country'],
'administrative_area' => $value['administrative_area'],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment