0

I need help for creating a custom migration. For now, I try to import field into d8, but fivestar fields from d7 don't have "type". Here is the message :

 drush migrate:messages upgrade_d7_field
 ------------------------------------------------ ------------------- ------- -----------------------------------------------------------------------------------------------------
  Source ID(s)                                     Destination ID(s)   Level   Message
 ------------------------------------------------ ------------------- ------- -----------------------------------------------------------------------------------------------------
  field_formation_interet, field_collection_item   ,                   1       Attempt to create a field storage field_formation_interet with no type.
                                                                               (/home/monbilanenligne/public_html/v2/web/core/modules/field/src/Entity/FieldStorageConfig.php:256)
  field_icone, field_collection_item               ,                   1       Attempt to create a field storage field_icone with no type.

both field are in a field collection, and depend on fivestar plugin (which is installed on d7 and d8). I think I have to specify in the source plugin which type for theses fields. in upgrade_d7_field config :

source:
  plugin: migration_custom_fields

But in this custom source plugin I don't know how to get the type of that field, and then specify 'fiverstar' ?

Maybe I should customized the process not the source plugin, but I found nothing on the web for process_field customization....

  type:
    -
      plugin: process_field
      source: type
      method: getFieldType
      map:
        d7_text:
          d7_text: d7_text
        file:
          file: file
        image:
          image: image
        entityreference:
          entityreference: entityreference
        datetime:
          datetime: datetime
        list:
          list: list
        number_default:
          number_default: number_default
        link_field:
          link_field: link_field

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.