Adding a little debugging to FarmLog.php seems to corroborate what I found above;
diff --git a/modules/core/migrate/src/Plugin/migrate/source/d7/FarmLog.php b/modules/core/migrate/src/Plugin/migrate/source/d7/FarmLog.php
index e5572601..e6ab86d8 100644
--- a/modules/core/migrate/src/Plugin/migrate/source/d7/FarmLog.php
+++ b/modules/core/migrate/src/Plugin/migrate/source/d7/FarmLog.php
@@ -155,7 +155,13 @@ class FarmLog extends Log {
// Add the quantity IDs to the row for future processing.
$row->setSourceProperty('log_quantities', $quantity_ids);
- return parent::prepareRow($row);
+ $preparedRow = parent::prepareRow($row);
+
+ $field_farm_asset = $this->getFieldvalues('log', 'field_farm_asset', $id);
+
+ $this->idMap->saveMessage(['id' => $id], "is_movement = $is_movement movement_areas = " . print_r($movement_areas, TRUE) . " field_farm_asset = " . print_r($field_farm_asset, TRUE), MigrationInterface::MESSAGE_WARNING);
+
+ return $preparedRow;
}
}
docker-compose.yml
chown www-data:www-data /opt/drupal/web/profiles/farm/modules/core/migrate/config/optional/migrate_plus.migration.farm_migrate_area_equipment_placeholder.yml
+ ln -sf /opt/testing_patched/FarmLog.php /opt/drupal/web/profiles/farm/modules/core/migrate/src/Plugin/migrate/source/d7/FarmLog.php
fi
wait_db_ready
...
volumes:
+ - '../../farmOS/modules/core/migrate/src/Plugin/migrate/source/d7/FarmLog.php:/opt/testing_patched/FarmLog.php:ro'
Re-running everything shows that the FarmLog plugin is setting is_movement = 1
and finding both the area tid
and asset target_id
for my asset;
$ docker-compose stop db2 www2 && docker-compose rm -f db2 www2 && sudo rm -rf db2 www2
$ docker-compose up -d
$ docker-compose exec -T www2 drush --root=/opt/drupal migrate-messages farm_migrate_log_activity | grep -A 17 8201
8201 8201 2 is_movement = 1 movement_areas =
Array
(
[0] => Array
(
[tid] => 858
)
)
field_farm_asset = Array
(
[0] => Array
(
[target_id] => 3358
)
)
Next I guess I need to dig a bit deeper into how the migration field setting/lookups actually work…