Problem/Motivation

\Drupal\location_migration\Plugin\migrate\field\Location::alterFieldInstanceMigration() does this:

$migration->mergeProcessOfProperty('settings', [
  'plugin' => 'location_to_address_field_settings',
]);

But \Drupal\migrate\Plugin\Migration::mergeProcessOfProperty() uses NestedArray::mergeDeepArray(), which causes

Steps to reproduce

Install the location_migration module and suddenly any node_reference D7 source field without referenceable_types will cease to produce the error that I reported at #3198732: Migrating reference fields: target_bundles may never be empty array. IOW: this can obscure a bug elsewhere, and cause wrong data to get migrated.

Proposed resolution

Append this to the process pipeline for settings.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Comments

Wim Leers created an issue. See original summary.

wim leers’s picture

Status: Active » Needs review
StatusFileSize
new755 bytes
huzooka’s picture

+++ b/src/Plugin/migrate/field/Location.php
@@ -44,9 +44,14 @@ class Location extends FieldPluginBase {
+    if (empty($current_process = $migration->getProcess()['settings'] ??NULL)) {
+      return;
+    }

I don't see what's the rationale behind this return statement...

Status: Needs review » Needs work

The last submitted patch, 3: location_migration-settings_process-3198937-3.patch, failed testing. View results

huzooka’s picture

Status: Needs work » Needs review

  • huzooka committed 3bcb7df on 1.0.x authored by Wim Leers
    Issue #3198937 by huzooka, Wim Leers: \Drupal\location_migration\Plugin\...
huzooka’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.