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.
Standard file fields can be configured to include a description field to go along with each file. Image fields can be configured to include alt and title fields for each image.
These properties are already exported correctly by node export. When file fields are imported, the values for these properties are missing.
Comment | File | Size | Author |
---|---|---|---|
#2 | 1868450-2-missing-file-field-properties.patch | 1.06 KB | milesw |
#1 | 1868450-1-missing-file-field-properties.patch | 1.52 KB | milesw |
Comments
Comment #1
milesw CreditAttribution: milesw commentedSmall change to retain the exported file field values.
Comment #2
milesw CreditAttribution: milesw commentedWithout the accidental newline addition.
Comment #3
brettbirschbach CreditAttribution: brettbirschbach commentedThanks for your patch miles! Just applied it on my project so that imported image fields preserve title/alt
Comment #4
cosmicdreams CreditAttribution: cosmicdreams commentedI have found that this patch does keep the values, but the values are not saved.
The specific problem I'm trying to solve is to keep the image titles or captions that I am importing.
Comment #5
cosmicdreams CreditAttribution: cosmicdreams commentedThe change also needs to be in _node_export_file_field_import_file(&$file), which overrites the incoming file data if the file already exists.
Comment #6
cosmicdreams CreditAttribution: cosmicdreams commentedI ultimately had to do this in node_export.module: _node_export_file_field_import_file(&$file)
Comment #8
danielb CreditAttribution: danielb commented