[PP-1] Provide option for contrib modules to map their D6 / D7 field formatter and widget plugin IDs to the equivalent D9 plugin ID

Created on 9 March 2021, almost 4 years ago
Updated 21 August 2024, 5 months ago

Problem/Motivation

Drupal core provides an "underlying API" with field migration plugins to specify a D6 / D7 β†’ D9 formatter and widget plugin ID mapping. The problem is that this feature is accessible only with a field migration plugin (and that is field type specific):

If a module has only formatters or widgets (but these are extending a field type which is not provided by the module), then for these modules, it is nearly impossible to tell Drupal's migration system that a specific Drupal 7 field formatter ID should be mapped to something else for Drupal 9.

For example, the Multiple Selects module β†’ would have a trivial migration path, but due to the issue described above, this is currently impossible to automate.

See #3188284: [PP-3] Migration support β†’ .

Proposed resolution

Create a new plugin ID mapper process plugin, move the related mapping logic into this plugin, and provide a hook for contribs to specify their plugin ID mapping.

Related 'logic':

  • MigrateFieldInterface::alterFieldInstanceMigration()
  • MigrateFieldInterface::getFieldFormatterType()
  • MigrateFieldInterface::getFieldFormatterMap()
  • MigrateFieldInterface::alterFieldWidgetMigration()
  • MigrateFieldInterface::getFieldWidgetType()
  • MigrateFieldInterface::getFieldWidgetMap()

Remaining tasks

User interface changes

Post-migration, my D7 content type that was migrated will now have the enhanced UX (with the appropriate widgets) that I'm used to as a site owner:

API changes

Two new hooks:

  1. hook_field_migration_field_formatter_info()
  2. hook_field_migration_field_widget_info()

Data model changes

Release notes snippet

✨ Feature request
Status

Postponed

Version

11.0 πŸ”₯

Component
MigrationΒ  β†’

Last updated 35 minutes ago

Created by

πŸ‡­πŸ‡ΊHungary huzooka Hungary πŸ‡­πŸ‡ΊπŸ‡ͺπŸ‡Ί

Live updates comments and jobs are added and updated live.
  • Contributed project blocker

    It denotes an issue that prevents porting of a contributed project to the stable version of Drupal due to missing APIs, regressions, and so on.

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