Error migrating nodes containing iframe field from D7 to D10

Created on 15 December 2023, 6 months ago
Updated 29 February 2024, 4 months ago

Problem/Motivation

TypeError: Drupal\iframe\Plugin\migrate\process\d7\CckIframe::create(): Argument #5 ($migration) must be of type ?Drupal\migrate\Entity\MigrationInterface, Drupal\node\Plugin\migrate\D7NodeTranslation given, called in /path_to_site/web/core/modules/migrate/src/Plugin/MigratePluginManager.php on line 57 in Drupal\iframe\Plugin\migrate\process\d7\CckIframe::create() (line 32 of /path_to_site/web/modules/contrib/iframe/src/Plugin/migrate/process/d7/CckIframe.php)
Using iframe 8.x-2.24 and Drupal 10.1.7

Steps to reproduce

  1. Create a node in D7, add an iframe field, add some content
  2. drush migrate:import --update d7_node_type, d7_field, d7_field_instance (note: I had no problem with d7_field and d7_field_instance as reported in other issues)
  3. drush migrate:import --update d7_metatag_field_instance:node:page (in my case it was the drupal 7 core "page" node type where I just added the iframe field)
  4. drush migrate:import --update d7_metatag_field_instance_widget_settings:node:page
  5. drush migrate:tree d7_node_complete:page

The migration stops with the above error and the usual drush backtrace

Proposed resolution

Indeed in file CckIframe.php line 32 we have public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) { but I can not fix why $migration (#5 argument) is not recognized in the right type.

There is a similar error in the disqus module's issues queue, perhaps this may be a beginning of a solution
https://www.drupal.org/project/disqus/issues/2879592 β†’

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs review

Version

2.24

Component

Code

Created by

πŸ‡«πŸ‡·France erwangel

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

Comments & Activities

Production build 0.69.0 2024