- Issue created by @DamienMcKenna
- πΊπΈUnited States DamienMcKenna NH, USA
The "Video" field type has two elements:
- [fieldname]_fid - file ID of the video.
- [fieldname]_thumbnail - file ID of the thumbnail.
it should be easy to provide a migration plugin to map the field data.
- πΊπΈUnited States DamienMcKenna NH, USA
A starting point:
namespace Drupal\media_migration\Plugin\migrate\field; use Drupal\migrate\Plugin\MigrationInterface; use Drupal\migrate_drupal\Plugin\migrate\field\FieldPluginBase; /** * @MigrateField( * id = "video", * core = {7}, * type_map = { * "video" = "entity_reference", * }, * source_module = "video", * destination_module = "core", * ) */ class VideoItem extends FieldPluginBase { /** * {@inheritdoc} */ public function getFieldWidgetMap() { return [ 'video_upload' => 'entity_reference', ]; } /** * {@inheritdoc} */ public function getFieldFormatterMap() { return [ 'video_formatter_player' => 'entity_reference_entity_view', ]; } /** * {@inheritdoc} */ public function defineValueProcessPipeline(MigrationInterface $migration, $field_name, $data) { $process = [ 'plugin' => 'sub_process', 'source' => $field_name, 'process' => [ 'target_id' => 'fid', ], ]; $migration->mergeProcessOfProperty($field_name, $process); } }