Add process to migrate quantity field collections to farm_quantity entities on all log types.
This commit is contained in:
parent
37c080d6d9
commit
5ff731a257
|
@ -15,7 +15,7 @@ class: Drupal\migrate\Plugin\Migration
|
|||
field_plugin_method: null
|
||||
cck_plugin_method: null
|
||||
source:
|
||||
plugin: d7_log
|
||||
plugin: d7_farm_log
|
||||
bundle: farm_activity
|
||||
destination:
|
||||
plugin: 'entity:log'
|
||||
|
@ -28,6 +28,27 @@ process:
|
|||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
# Create a quantity for each quantity field collection.
|
||||
quantity:
|
||||
plugin: sub_process
|
||||
source: log_quantities
|
||||
process:
|
||||
# Save the units term as a pseudo value.
|
||||
_units:
|
||||
plugin: migration_lookup
|
||||
migration: farm_migrate_taxonomy_unit
|
||||
source: units
|
||||
no_stub: true
|
||||
# Create a quantity and save the ID.
|
||||
target_id:
|
||||
plugin: create_quantity
|
||||
values:
|
||||
units: '@_units'
|
||||
label: label
|
||||
measure: measure
|
||||
value/numerator: value_numerator
|
||||
value/denominator: value_denominator
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
required:
|
||||
- farm_migrate_taxonomy_unit
|
||||
optional: { }
|
||||
|
|
|
@ -28,10 +28,31 @@ process:
|
|||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
# Create a quantity for each quantity field collection.
|
||||
quantity:
|
||||
plugin: sub_process
|
||||
source: log_quantities
|
||||
process:
|
||||
# Save the units term as a pseudo value.
|
||||
_units:
|
||||
plugin: migration_lookup
|
||||
migration: farm_migrate_taxonomy_unit
|
||||
source: units
|
||||
no_stub: true
|
||||
# Create a quantity and save the ID.
|
||||
target_id:
|
||||
plugin: create_quantity
|
||||
values:
|
||||
units: '@_units'
|
||||
label: label
|
||||
measure: measure
|
||||
value/numerator: value_numerator
|
||||
value/denominator: value_denominator
|
||||
# Harvest specific fields.
|
||||
lot_number:
|
||||
plugin: get
|
||||
source: field_farm_lot_number
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
required:
|
||||
- farm_migrate_taxonomy_unit
|
||||
optional: { }
|
||||
|
|
|
@ -28,6 +28,26 @@ process:
|
|||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
# Create a quantity for each quantity field collection.
|
||||
quantity:
|
||||
plugin: sub_process
|
||||
source: log_quantities
|
||||
process:
|
||||
# Save the units term as a pseudo value.
|
||||
_units:
|
||||
plugin: migration_lookup
|
||||
migration: farm_migrate_taxonomy_unit
|
||||
source: units
|
||||
no_stub: true
|
||||
# Create a quantity and save the ID.
|
||||
target_id:
|
||||
plugin: create_quantity
|
||||
values:
|
||||
units: '@_units'
|
||||
label: label
|
||||
measure: measure
|
||||
value/numerator: value_numerator
|
||||
value/denominator: value_denominator
|
||||
# Input specific fields.
|
||||
lot_number:
|
||||
plugin: get
|
||||
|
@ -52,4 +72,5 @@ process:
|
|||
migration_dependencies:
|
||||
required:
|
||||
- farm_migrate_taxonomy_material
|
||||
- farm_migrate_taxonomy_unit
|
||||
optional: { }
|
||||
|
|
|
@ -30,6 +30,26 @@ process:
|
|||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
# Create a quantity for each quantity field collection.
|
||||
quantity:
|
||||
plugin: sub_process
|
||||
source: log_quantities
|
||||
process:
|
||||
# Save the units term as a pseudo value.
|
||||
_units:
|
||||
plugin: migration_lookup
|
||||
migration: farm_migrate_taxonomy_unit
|
||||
source: units
|
||||
no_stub: true
|
||||
# Create a quantity and save the ID.
|
||||
target_id:
|
||||
plugin: create_quantity
|
||||
values:
|
||||
units: '@_units'
|
||||
label: label
|
||||
measure: measure
|
||||
value/numerator: value_numerator
|
||||
value/denominator: value_denominator
|
||||
# Lab test specific fields.
|
||||
lab:
|
||||
plugin: get_lab
|
||||
|
@ -40,5 +60,6 @@ process:
|
|||
farm_soil_test: soil
|
||||
farm_water_test: water
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
required:
|
||||
- farm_migrate_taxonomy_unit
|
||||
optional: { }
|
||||
|
|
|
@ -28,6 +28,27 @@ process:
|
|||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
# Create a quantity for each quantity field collection.
|
||||
quantity:
|
||||
plugin: sub_process
|
||||
source: log_quantities
|
||||
process:
|
||||
# Save the units term as a pseudo value.
|
||||
_units:
|
||||
plugin: migration_lookup
|
||||
migration: farm_migrate_taxonomy_unit
|
||||
source: units
|
||||
no_stub: true
|
||||
# Create a quantity and save the ID.
|
||||
target_id:
|
||||
plugin: create_quantity
|
||||
values:
|
||||
units: '@_units'
|
||||
label: label
|
||||
measure: measure
|
||||
value/numerator: value_numerator
|
||||
value/denominator: value_denominator
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
required:
|
||||
- farm_migrate_taxonomy_unit
|
||||
optional: { }
|
||||
|
|
|
@ -28,10 +28,31 @@ process:
|
|||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
# Create a quantity for each quantity field collection.
|
||||
quantity:
|
||||
plugin: sub_process
|
||||
source: log_quantities
|
||||
process:
|
||||
# Save the units term as a pseudo value.
|
||||
_units:
|
||||
plugin: migration_lookup
|
||||
migration: farm_migrate_taxonomy_unit
|
||||
source: units
|
||||
no_stub: true
|
||||
# Create a quantity and save the ID.
|
||||
target_id:
|
||||
plugin: create_quantity
|
||||
values:
|
||||
units: '@_units'
|
||||
label: label
|
||||
measure: measure
|
||||
value/numerator: value_numerator
|
||||
value/denominator: value_denominator
|
||||
# Medical specific fields.
|
||||
vet:
|
||||
plugin: get
|
||||
source: field_farm_vet
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
required:
|
||||
- farm_migrate_taxonomy_unit
|
||||
optional: { }
|
||||
|
|
|
@ -28,6 +28,27 @@ process:
|
|||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
# Create a quantity for each quantity field collection.
|
||||
quantity:
|
||||
plugin: sub_process
|
||||
source: log_quantities
|
||||
process:
|
||||
# Save the units term as a pseudo value.
|
||||
_units:
|
||||
plugin: migration_lookup
|
||||
migration: farm_migrate_taxonomy_unit
|
||||
source: units
|
||||
no_stub: true
|
||||
# Create a quantity and save the ID.
|
||||
target_id:
|
||||
plugin: create_quantity
|
||||
values:
|
||||
units: '@_units'
|
||||
label: label
|
||||
measure: measure
|
||||
value/numerator: value_numerator
|
||||
value/denominator: value_denominator
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
required:
|
||||
- farm_migrate_taxonomy_unit
|
||||
optional: { }
|
||||
|
|
|
@ -28,6 +28,26 @@ process:
|
|||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
# Create a quantity for each quantity field collection.
|
||||
quantity:
|
||||
plugin: sub_process
|
||||
source: log_quantities
|
||||
process:
|
||||
# Save the units term as a pseudo value.
|
||||
_units:
|
||||
plugin: migration_lookup
|
||||
migration: farm_migrate_taxonomy_unit
|
||||
source: units
|
||||
no_stub: true
|
||||
# Create a quantity and save the ID.
|
||||
target_id:
|
||||
plugin: create_quantity
|
||||
values:
|
||||
units: '@_units'
|
||||
label: label
|
||||
measure: measure
|
||||
value/numerator: value_numerator
|
||||
value/denominator: value_denominator
|
||||
# Purchase specific fields.
|
||||
invoice_number:
|
||||
plugin: get
|
||||
|
@ -36,5 +56,6 @@ process:
|
|||
plugin: get
|
||||
source: field_farm_seller
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
required:
|
||||
- farm_migrate_taxonomy_unit
|
||||
optional: { }
|
||||
|
|
|
@ -28,6 +28,26 @@ process:
|
|||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
# Create a quantity for each quantity field collection.
|
||||
quantity:
|
||||
plugin: sub_process
|
||||
source: log_quantities
|
||||
process:
|
||||
# Save the units term as a pseudo value.
|
||||
_units:
|
||||
plugin: migration_lookup
|
||||
migration: farm_migrate_taxonomy_unit
|
||||
source: units
|
||||
no_stub: true
|
||||
# Create a quantity and save the ID.
|
||||
target_id:
|
||||
plugin: create_quantity
|
||||
values:
|
||||
units: '@_units'
|
||||
label: label
|
||||
measure: measure
|
||||
value/numerator: value_numerator
|
||||
value/denominator: value_denominator
|
||||
# Sale specific fields.
|
||||
customer:
|
||||
plugin: get
|
||||
|
@ -36,5 +56,6 @@ process:
|
|||
plugin: get
|
||||
source: field_farm_invoice_number
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
required:
|
||||
- farm_migrate_taxonomy_unit
|
||||
optional: { }
|
||||
|
|
|
@ -28,6 +28,26 @@ process:
|
|||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
# Create a quantity for each quantity field collection.
|
||||
quantity:
|
||||
plugin: sub_process
|
||||
source: log_quantities
|
||||
process:
|
||||
# Save the units term as a pseudo value.
|
||||
_units:
|
||||
plugin: migration_lookup
|
||||
migration: farm_migrate_taxonomy_unit
|
||||
source: units
|
||||
no_stub: true
|
||||
# Create a quantity and save the ID.
|
||||
target_id:
|
||||
plugin: create_quantity
|
||||
values:
|
||||
units: '@_units'
|
||||
label: label
|
||||
measure: measure
|
||||
value/numerator: value_numerator
|
||||
value/denominator: value_denominator
|
||||
# Seeding specific fields.
|
||||
lot_number:
|
||||
plugin: get
|
||||
|
@ -36,5 +56,6 @@ process:
|
|||
plugin: get
|
||||
source: field_farm_seed_source
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
required:
|
||||
- farm_migrate_taxonomy_unit
|
||||
optional: { }
|
||||
|
|
|
@ -28,6 +28,27 @@ process:
|
|||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
# Create a quantity for each quantity field collection.
|
||||
quantity:
|
||||
plugin: sub_process
|
||||
source: log_quantities
|
||||
process:
|
||||
# Save the units term as a pseudo value.
|
||||
_units:
|
||||
plugin: migration_lookup
|
||||
migration: farm_migrate_taxonomy_unit
|
||||
source: units
|
||||
no_stub: true
|
||||
# Create a quantity and save the ID.
|
||||
target_id:
|
||||
plugin: create_quantity
|
||||
values:
|
||||
units: '@_units'
|
||||
label: label
|
||||
measure: measure
|
||||
value/numerator: value_numerator
|
||||
value/denominator: value_denominator
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
required:
|
||||
- farm_migrate_taxonomy_unit
|
||||
optional: { }
|
||||
|
|
Loading…
Reference in New Issue