Created
October 13, 2023 13:40
-
-
Save junaidpv/0b22dd0379ff327a61775f6f4a5619dd to your computer and use it in GitHub Desktop.
This fixes errors appearing when running upgrade_d7_field_instance migraiton while it migrate image type fields.
This file contains 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/core/modules/field/src/Plugin/migrate/process/d7/FieldInstanceSettings.php b/core/modules/field/src/Plugin/migrate/process/d7/FieldInstanceSettings.php | |
index 5236e5507a..fcf66af257 100644 | |
--- a/core/modules/field/src/Plugin/migrate/process/d7/FieldInstanceSettings.php | |
+++ b/core/modules/field/src/Plugin/migrate/process/d7/FieldInstanceSettings.php | |
@@ -126,6 +126,18 @@ public function transform($value, MigrateExecutableInterface $migrate_executable | |
'uuid' => '', | |
]; | |
break; | |
+ case 'media_generic': | |
+ $settings = $instance_settings; | |
+ if (isset($instance_settings['default_image']) && $instance_settings['default_image'] === 0) { | |
+ $settings['default_image'] = [ | |
+ 'alt' => '', | |
+ 'title' => '', | |
+ 'width' => NULL, | |
+ 'height' => NULL, | |
+ 'uuid' => '', | |
+ ]; | |
+ } | |
+ break; | |
default: | |
$settings = $instance_settings; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment