Following the discussion on https://www.drupal.org/node/1080386#comment-10838412.

When using the Media browser widget for an a image. I cannot map the alt and title fields.

The field values are stored in the tables field_data_field_file_image_title_text and field_data_field_file_image_alt_text - not in field_data_field_image which occurs when the widget Image is chosen.

Comments

abelass created an issue. See original summary.

abelass’s picture

Component: Miscellaneous » Code
siramsay’s picture

I am looking at importing images and need to map alt and title fields to a image field type using media browser widget.

did you manage to find a solution?

jerry’s picture

I'd be very interested in a way to target the alt and title fields of images imported into file entities via multi-value image fields.

siramsay’s picture

After looking into this I am unsure if this is the right place for this unless you wanted to make some mappers for the Media alt and title fields. This would need to be done using a feeds hook, maybe hook_feeds_after_import, as you need to know the image fid so the relationship can be made between the alt and title and image.

However feeds already has mappers for the alt and title so if this is all you want to map then you don't need Media Feeds at all. You can use these mappers and then sync after import.

To sync after import you need VBO and a small custom module that I will post below soon but you can check here #2070183: Sync alt and title text between file entity and standard image field.

What I do is import bulk nodes, go to content page, bulk save the new content with VBO and clear cache. I will posted more notes soon below. But as stated Media Feed is not needed.

besek’s picture

Hi size,

did you managed to create this custom module? I'm asking, because I have the same issue and I'm trying to find a way to automatically synchronise content from field_image_alt into field_data_field_file_image_alt_text after each feeds import.

siramsay’s picture

as stated Media Feed is not needed.

I just used #2070183-7: Sync alt and title text between file entity and standard image field (comment #7)

and then

  1. import bulk nodes using Images: Alt (field_album_images:alt) etc. in Feeds target
  2. go to admin/content page
  3. bulk save the new content with VBO
  4. clear cache

I have found that if you do use Update existing nodes in node processor of the feed importers setting page, then from initial testing no need to re-save nodes as on update node is saved.

It is the saving of the nodes that sync alts and title module is run. This could be written as a module but don't really think this is the right place for it as Media Feed is not needed.

siramsay’s picture