Remove deprecated MigrateCckField plugin and replace with a MigrateField plugin to allow migrations of the name field to Drupal 9+

Created on 10 January 2022, almost 3 years ago
Updated 2 March 2023, almost 2 years ago

Problem

While executing a migration from D7 to D9, Name fields are not migrated during the field migration; an error is thrown: "Attempt to create a field storage [field] with no type." Subsequent migrations of content types that use the field are not executed and the data are left behind.

The field migration in 8.x-1.0 RC uses the MigrateCckField annotation in src/Plugin/migrate/cckfield/NameItem.php - Looking at the API documentation for MigrateCckField.php we see that the annotation was deprecated in D8.3 and was removed in D9.0:
https://api.drupal.org/api/drupal/core%21modules%21migrate_drupal%21src%...

So, what appears to be happening is that the migration plugin is no longer loaded by D9, thus making the field type orphaned during migration.

Steps to reproduce

Initialize a fresh D9 site with Name field installed and migration modules installed and enabled; attempt to run a migrate-import from a D7 database containing at least one content type with a Name field instance.

Proposed resolution

Refactor & relocate NameItem.php to use the MigrateField annotation and class methods.

Remaining tasks

1. Determine if refactoring requires a change in API requirement for the module (time for a D9 version?)
2. Refactor
3. Test

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States tkiehne

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024