Hello all

I need to migrate a Media Asset field (Media Module). For File fields there is a class MigrateFileFieldHandler which extends MigrateFieldHandler. Is there any class for Media Assets fields?

Thank you

Comments

moshe weitzman’s picture

Status: Active » Fixed

Yes. See migrate_extras project - http://drupal.org/project/migrate_extras

parallax’s picture

Status: Fixed » Closed (fixed)

Excelent

parallax’s picture

My media asset has two additional fields "description" and "title". Is there any examples of that class? This is what I am using:


 			$media_arguments = MigrateMediaFieldHandler::arguments(
	 		DRUPAL_ROOT.'/sites/default/files/temp',
		  	  'file_copy', 
 					FILE_EXISTS_RENAME,
 					NULL,
 					NULL,
					array('source_field' => $row->xml->NewsComponent->NewsLines->HeadLine), // Alt
 					array('source_field' => $row->xml->NewsComponent->NewsLines->HeadLine), // Title
	 				array('source_field' => $row->xml->NewsComponent->NewsLines->HeadLine)  // Description
 				);
 				$this->addFieldMapping('field_media', 'image')
 					->xpath('NewsComponent/NewsComponent/ContentItem/DataContent/nitf/image')
 					->arguments($media_arguments);
parallax’s picture

Status: Closed (fixed) » Active
mikeryan’s picture

Project: Migrate » Migrate Extras
Version: 7.x-2.1 » 7.x-2.x-dev
Component: Code » Media
Priority: Major » Normal
mikeryan’s picture

Status: Active » Postponed (maintainer needs more info)

Can you describe exactly what problem you're seeing? It's not clear to me what you're looking for...

parallax’s picture

My content type has a field of the type "media". When I import the image with the MigrateMediaFieldHandler, the Image is properly imported but with no description and title. An image of Type image, may also have additional fields, not only description and title. How do I use MigrateMediaFieldHandler to write these fields?

Thank you!

parallax’s picture

I ment, a field of type "media" may also have more field... how do I write these fields?

naxoc’s picture

I am curious to know how to write to those fields too

mikeryan’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

The media module no longer has its own "media" entity type. And, all the file handling stuff has been rewritten for Migrate 2.4 - see http://drupal.org/node/1540106 and http://drupal.org/node/1546120#comment-5981846.