diff --git a/Core/FieldHandler/EzImageAsset.php b/Core/FieldHandler/EzImageAsset.php
new file mode 100644
index 00000000..1c58678d
--- /dev/null
+++ b/Core/FieldHandler/EzImageAsset.php
@@ -0,0 +1,56 @@
+contentMatcher = $contentMatcher;
+ }
+
+ /**
+ * Creates a value object to use as the field value when setting an ez image asset field type.
+ *
+ * @param array|string|int $fieldValue The definition of the field value, structured in the yml file
+ * @param array $context The context for execution of the current migrations. Contains f.e. the path to the migration
+ * @return Value
+ */
+ public function hashToFieldValue($fieldValue, array $context = array())
+ {
+ $altText = '';
+
+ if ($fieldValue === null) {
+ return new Value();
+ }
+ if (isset($fieldValue['alt_text'])) {
+ $altText = $fieldValue['alt_text'];
+ }
+
+ if (is_array($fieldValue) && array_key_exists('destinationContentId', $fieldValue)) {
+ // fromHash format
+ $id = $fieldValue['destinationContentId'];
+ } else {
+ // simplified format
+ $id = $fieldValue;
+ }
+
+ if ($id === null) {
+ return new Value();
+ }
+
+ // 1. resolve relations
+ $id = $this->referenceResolver->resolveReference($id);
+ // 2. resolve remote ids
+ $id = $this->contentMatcher->matchOneByKey($id)->id;
+
+ return new Value($id, $altText);
+ }
+}
\ No newline at end of file
diff --git a/Resources/config/services.yml b/Resources/config/services.yml
index e4dffdc7..c2c0d84e 100644
--- a/Resources/config/services.yml
+++ b/Resources/config/services.yml
@@ -98,6 +98,7 @@ parameters:
ez_migration_bundle.complex_field.ezimage.class: Kaliop\eZMigrationBundle\Core\FieldHandler\EzImage
ez_migration_bundle.complex_field.ezmedia.class: Kaliop\eZMigrationBundle\Core\FieldHandler\EzMedia
ez_migration_bundle.complex_field.ezpage.class: Kaliop\eZMigrationBundle\Core\FieldHandler\EzPage
+ ez_migration_bundle.complex_field.ezimageasset.class: Kaliop\eZMigrationBundle\Core\FieldHandler\EzImageAsset
ez_migration_bundle.complex_field.ezrelation.class: Kaliop\eZMigrationBundle\Core\FieldHandler\EzRelation
ez_migration_bundle.complex_field.ezrelationlist.class: Kaliop\eZMigrationBundle\Core\FieldHandler\EzRelationList
ez_migration_bundle.complex_field.ezrichtext.class: Kaliop\eZMigrationBundle\Core\FieldHandler\EzRichText
@@ -661,6 +662,14 @@ services:
tags:
- { name: ez_migration_bundle.complex_field, fieldtype: ezobjectrelation, priority: 0 }
+ ez_migration_bundle.complex_field.ezimageasset:
+ parent: ez_migration_bundle.complex_field
+ class: '%ez_migration_bundle.complex_field.ezimageasset.class%'
+ arguments:
+ - '@ez_migration_bundle.content_matcher'
+ tags:
+ - { name: ez_migration_bundle.complex_field, fieldtype: ezimageasset, priority: 0 }
+
ez_migration_bundle.complex_field.ezrelationlist:
parent: ez_migration_bundle.complex_field
class: '%ez_migration_bundle.complex_field.ezrelationlist.class%'
diff --git a/Tests/dsl/UnitTest0190_create_eZImage_content_type.yml b/Tests/dsl/UnitTest0190_create_eZImage_content_type.yml
new file mode 100644
index 00000000..ec07f710
--- /dev/null
+++ b/Tests/dsl/UnitTest0190_create_eZImage_content_type.yml
@@ -0,0 +1,40 @@
+-
+ type: content_type
+ mode: update
+ remove_drafts: true
+ match:
+ contenttype_identifier: image
+ attributes:
+ -
+ identifier: slide_format
+ type: ezselection
+ name:
+ fre-FR: Format
+ description: { }
+ required: true
+ searchable: false
+ info-collector: false
+ disable-translation: false
+ category: content
+ position: 4
+ field-settings:
+ isMultiple: false
+ options: [Square, Landscape, Portrait]
+ validator-configuration: { }
+
+-
+ type: content
+ mode: delete
+ match:
+ content_type_identifier: gallery_slide
+-
+ type: trash
+ mode: delete
+ match:
+ content_type_identifier: gallery_slide
+-
+ type: content_type
+ mode: delete
+ remove_drafts: true
+ match:
+ identifier: gallery_slide
diff --git a/Tests/dsl/UnitTest0191_create_eZImage_content.yml b/Tests/dsl/UnitTest0191_create_eZImage_content.yml
new file mode 100644
index 00000000..a3129a8c
--- /dev/null
+++ b/Tests/dsl/UnitTest0191_create_eZImage_content.yml
@@ -0,0 +1,27 @@
+-
+ type: content
+ mode: create
+ content_type: image
+ parent_location: 2
+ priority: 0
+ is_hidden: false
+ sort_field: path
+ sort_order: ASC
+ remote_id: 0c6ca3b36823ab38b9c8a8b79d5b12fd
+ location_remote_id: f17baf9b7fac9fa91ea2c1f76dcbd39c
+ lang: fre-FR
+ section: 1
+ owner: 14
+ modification_date: 1556889738
+ publication_date: 1556889738
+ always_available: true
+ attributes:
+ name: 'eZPlatform img'
+ caption:
+ xml: "\n