Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Same problem as in #2313241: d6_taxonomy_term migrate fails when the parent term has not been already migrated.
The bug was reintroduced in #2348875: Improving our dump files.
git show ec9a3ec27da1c9f2cb6a4568e8fae5f4b1b54c32 -- core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyTermTest.php
shows the bad change.
Proposed resolution
Add explicit test coverage for stubbed taxonomy terms.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#12 | 2590215-12.patch | 5.03 KB | webflo |
Comments
Comment #2
webflo CreditAttribution: webflo at UEBERBIT GmbH commentedComment #3
webflo CreditAttribution: webflo at UEBERBIT GmbH commentedComment #4
webflo CreditAttribution: webflo at UEBERBIT GmbH commentedThe test in #3 didn't fail because migrate catches all exceptions in destination and process plugins.
Comment #6
webflo CreditAttribution: webflo at UEBERBIT GmbH commentedThe default_langcode is not required.
Comment #7
webflo CreditAttribution: webflo at UEBERBIT GmbH commentedComment #8
webflo CreditAttribution: webflo at UEBERBIT GmbH commentedComment #9
phenaproximaThis looks good to me but I'd like to see a dedicated test of the EntityTaxonomyTerm destination. It could be a kernel test that passes a stub row to import() and ensure that it's created as expected, without exceptions.
Comment #10
webflo CreditAttribution: webflo at UEBERBIT GmbH commentedComment #11
phenaproximaMissing @file comment.
Nit: This can be a single line.
Migration::create($config)->getDestinationPlugin()
Can this be a little more verbose?
Nit: Should be
/** @var ... */
, all on one line. And TermInterface should be the fully-qualified name of the interface.assertSame() is preferred over assertEquals().
As with before, can this be better explained?
Comment #12
webflo CreditAttribution: webflo at UEBERBIT GmbH commentedComment #13
phenaproximaPrime.
Comment #14
mikeryanHold on now - #2590993: Create stub entities with proper default values supercedes this...
Comment #15
mikeryanFixed by #2590993: Create stub entities with proper default values.