You are here

uc_attribute_field.yml in Commerce Migrate 3.1.x

modules/ubercart/migrations/uc_attribute_field.yml

File

modules/ubercart/migrations/uc_attribute_field.yml
View source
  1. id: uc_attribute_field
  2. label: Ubercart attribute field storage
  3. migration_tags:
  4. - Drupal 6
  5. - Drupal 7
  6. - Ubercart
  7. - Configuration
  8. source:
  9. plugin: uc_attribute
  10. constants:
  11. langcode: en
  12. entity_type: commerce_product_variation
  13. field_name_prefix: attribute
  14. target_type: commerce_product_attribute_value
  15. type: entity_reference
  16. process:
  17. aid: aid
  18. entity_type: 'constants/entity_type'
  19. langcode: 'constants/langcode'
  20. field_machine_name:
  21. -
  22. plugin: machine_name
  23. source: name
  24. -
  25. plugin: substr
  26. length: 20
  27. -
  28. plugin: make_unique_entity_field
  29. entity_type: field_storage_config
  30. field: field_machine_name
  31. field_name:
  32. plugin: concat
  33. source:
  34. - 'constants/field_name_prefix'
  35. - '@field_machine_name'
  36. delimiter: _
  37. type: 'constants/type'
  38. settings/target_type: 'constants/target_type'
  39. # Set the cardinality from the 4 display types
  40. # used in module uc_attribute.
  41. # @link http://cgit.drupalcode.org/ubercart/tree/uc_attribute/uc_attribute.module?h=6.x-2.x#n1378 @endlink
  42. # @link http://cgit.drupalcode.org/ubercart/tree/uc_attribute/uc_attribute.module?h=7.x-3.x#n1465 @endlink
  43. cardinality:
  44. plugin: static_map
  45. bypass: true
  46. source: display
  47. map:
  48. # Text field
  49. 0: 1
  50. # Select box
  51. 1: 1
  52. # Radio buttons
  53. 2: 1
  54. # Checkboxes
  55. 3: -1
  56. destination:
  57. plugin: entity:field_storage_config
  58. destination_module: field