Single article on site with image in default image field: d7_node_complete:article missing dependency on d7_file_plain:image:public

Created on 10 June 2021, over 3 years ago
Updated 25 May 2023, over 1 year ago

Problem/Motivation

d7_node_complete:article does depend on d7_file, but does not depend on d7_file_plain:image:public.

Consequence:

[node: 1, revision: 1]: field_image.0.target_id=The referenced entity (media: 1) does not exist.

A validation error, because the article was migrated after the image file was migrated (👍), but before the image media entity was created (👎).

Steps to reproduce

  1. Default D7 Standard install profile.
  2. Create an article, upload an image
  3. Migrate using media_migration
  4. Observe how d7_node_complete:article did not get a dependency on d7_file_plain:image:public.

Proposed resolution

Automatically add this dependency.

Remaining tasks

API changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

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.

  • 🇺🇸United States mortona2k Seattle

    I may be hitting this, here's how I got here:

    1. Install fresh d10 site w/ migrate_plus, migrate_drupal, migrate_tools, media_migration, migrate_upgrade.
    2. Configure migrate_upgrade, export configuration. This creates the upgrade_drupal_7 migration group. My understanding is that the migrations to use are prefixed with upgrade_d7_ and not ones in the default group that start with d6_ or d7_.
    3. When I run migrate:tree on a complete node migration:

    upgrade_d7_node_complete_artwork
    ├──upgrade_d7_user
    │  └──upgrade_d7_user_role
    ├──upgrade_d7_node_type
    ├──upgrade_d7_file_entity_image_public
    │  ├──upgrade_d7_file_entity_type_image
    │  │  └──upgrade_d7_file_entity_source_field_image
    │  ├──upgrade_d7_file_entity_source_field_config_image
    │  │  ├──upgrade_d7_file_entity_source_field_image
    │  │  └──upgrade_d7_file_entity_type_image
    │  │     └──upgrade_d7_file_entity_source_field_image
    │  ├──upgrade_d7_field_instance
    │  │  ├──upgrade_d7_field
    │  │  └──upgrade_d7_node_type
    │  └──upgrade_d7_file
    ├──upgrade_d7_file_entity_video_public
    │  ├──upgrade_d7_file_entity_type_video
    │  │  └──upgrade_d7_file_entity_source_field_video
    │  ├──upgrade_d7_file_entity_source_field_config_video
    │  │  ├──upgrade_d7_file_entity_source_field_video
    │  │  └──upgrade_d7_file_entity_type_video
    │  │     └──upgrade_d7_file_entity_source_field_video
    │  ├──upgrade_d7_field_instance
    │  │  ├──upgrade_d7_field
    │  │  └──upgrade_d7_node_type
    │  └──upgrade_d7_file
    ├──upgrade_d7_file_entity_video_youtube
    │  ├──upgrade_d7_file_entity_type_remote_video
    │  │  └──upgrade_d7_file_entity_source_field_remote_video
    │  ├──upgrade_d7_file_entity_source_field_config_remote_video
    │  │  ├──upgrade_d7_file_entity_source_field_remote_video
    │  │  └──upgrade_d7_file_entity_type_remote_video
    │  │     └──upgrade_d7_file_entity_source_field_remote_video
    │  └──upgrade_d7_field_instance
    │     ├──upgrade_d7_field
    │     └──upgrade_d7_node_type
    ├──upgrade_d7_file_entity_video_vimeo
    │  ├──upgrade_d7_file_entity_type_remote_video
    │  │  └──upgrade_d7_file_entity_source_field_remote_video
    │  ├──upgrade_d7_file_entity_source_field_config_remote_video
    │  │  ├──upgrade_d7_file_entity_source_field_remote_video
    │  │  └──upgrade_d7_file_entity_type_remote_video
    │  │     └──upgrade_d7_file_entity_source_field_remote_video
    │  └──upgrade_d7_field_instance
    │     ├──upgrade_d7_field
    │     └──upgrade_d7_node_type
    └──d7_file_entity:image:public
       ├──d7_file_entity_type:image
       │  └──d7_file_entity_source_field:image
       ├──d7_file_entity_source_field_config:image
       │  ├──d7_file_entity_source_field:image
       │  └──d7_file_entity_type:image
       │     └──d7_file_entity_source_field:image
       ├──d7_field_instance
       │  └──d7_field
       └──d7_file
    

    I don't think d7_file_entity:image:public should be running here at all. It's being added in media_migration_migration_plugins_alter(), calling the media_migration.migrate_plugin_alterer service. All the migrations under that one appear to have replacements with upgrade_d7 prefixes.

    I think what's happening is that this media migration hook and the derived migrations in the module are conflicting with generated config. It makes sense to have this happen during the config export, but after that, I want to disable this migration alter and skip generating the derived migrations (since I already have them generated).

  • 🇺🇸United States mortona2k Seattle

    It happens in MigratePluginAlterer->addMediaWysiwygProcessor().

Production build 0.71.5 2024