From aa510febea6dff764e7d9ee67b0241bc97a66689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Thu, 16 Nov 2023 11:17:26 -0500 Subject: [PATCH] Creating one of each term is quite enough, thanks --- migration_helpers.module | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/migration_helpers.module b/migration_helpers.module index 4710a58..ce46bac 100644 --- a/migration_helpers.module +++ b/migration_helpers.module @@ -90,6 +90,11 @@ function migration_helpers_move_terms( $new_term->save(); $tid = $new_term->id(); \Drupal::logger('mass')->log(LogLevel::INFO, "Term $term_name created with TID $tid in vocabulary $destination_vocabulary."); + + // Because we did the query only once, before we entered this loop, we + // need to add our newly created terms to the term data array we use to + // check for existing terms… or we'll keep creating duplicates. + $term_data[$new_term->id()] = $new_term->label(); } $tids[] = $tid; }