Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It took me a while, to figure out why the migrated files where added to files_managed but actually not attached to the file field. The problem was by default y set the subfield language to the entity language, but the file field by default is not translatable so it should be LANGUAGE_NONE instead.
Would be nice if migrate offers the language subfield only for translatable fields to not mislead developers.
Comment | File | Size | Author |
---|---|---|---|
#4 | migrate-field-language-2472045-4.patch | 1.56 KB | osopolar |
#1 | migrate-field-language-2472045-1.patch | 1.51 KB | osopolar |
Comments
Comment #1
osopolarPatch attached.
Currently I don't have enough migrations to widely test the changes, but it is working for body field (translatable) and file field (not translatable).
Comment #2
osopolarComment #3
mikeryanI'd suggest using field_is_translatable(), which also checks for a translation handler.
Comment #4
osopolarDo you mean like this:
Comment #5
osopolarComment #6
mikeryanThat looks good to me. I don't have suitable data to test locally - is there someone else out there who can verify and set the status to rtbc?
Thanks.
Comment #8
mikeryanWent ahead and committed this, thanks!
Comment #9
mikeryan