Problem/Motivation

#2724941: Need to be able to lookup destination IDs by partial source IDs deprecated \Drupal\migrate\Plugin\MigrateIdMapInterface::lookupDestinationId() before deprecation testing was a thing and it never removed all the usages.

Proposed resolution

  • Remove all usages
  • Add @trigger_error
  • Think about testing

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

N/a

CommentFileSizeAuthor
#2 3068089-2.patch24.69 KBalexpott
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
FileSize
24.69 KB
mikelutz’s picture

Status: Needs review » Reviewed & tested by the community
Related issues: +#2890844: Migration Lookup plugin does not return multiple values when matched
+++ b/core/modules/migrate/src/Plugin/migrate/process/MigrationLookup.php
@@ -182,7 +182,9 @@ public function transform($value, MigrateExecutableInterface $migrate_executable
+      $lookup = $lookup_migration->getIdMap()->lookupDestinationIds($source_id_values[$lookup_migration_id]);
+      if (!empty($lookup)) {
+        $destination_ids = $lookup[0];

I wondered if this should just be if ($destination_ids = reset($lookup)) break; but this is fine, and there is follow-up work around this block in #2890844: Migration Lookup plugin does not return multiple values when matched to actually allow access to the rest of the matches instead of just throwing them away.

All straightforward, ready to go.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 5a27c27 and pushed to 8.8.x. Thanks!

  • catch committed 5a27c27 on 8.8.x
    Issue #3068089 by alexpott, mikelutz: Properly deprecate \Drupal\migrate...
catch’s picture

Status: Fixed » Closed (fixed)

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