# idlist=43615,53523,53524,58332,58333,58681,58682,58683,69219,69221,69235,69236,69237,69238,70903,72618,72619

# This is the migrations file from Flag Lists D7
id: d7_flaglistitems
label: Materio Flag List Items D7
migration_group: d7_materio
#audit: true
migration_tags:
  - Drupal 7
  - Content
migration_dependencies:
  required:
    - d7_users
    - d7_node_article
    - d7_node_materiau
    - d7_flaglists
source:
  plugin: d7_flaglistitems_materio
#
process:
  # id: fcid
  # user_id: uid
  user_id:
    plugin: migration_lookup
    migration: d7_users
    source: uid

  type: entity_type

  # flag_list: fid
  flag_list:
    plugin: migration_lookup
    migration: d7_flaglists
    source: fid

  baseflag: baseflag
  # baseflag:
  #   plugin: skip_on_empty
  #   method: row
  #   source: relatedflag

  # TODO: skip if article or enable flaging of articles on D8
  entity_id:
    plugin: migration_lookup
    migration:
      - d7_node_materiau
      - d7_node_article
    no_stub: true
    source: entity_id


  #use the destination entity_id isnstead of the original id
  # use the destination flag_collection instead of original title
  name:
    plugin: concat
    source:
      - flagcolname
      - dest_entity_id
    delimiter: ' '

#
destination:
  plugin: entity:flag_list_item
