Problem/Motivation

Migration plugins can use shared configuration with their configured migration group. In some situations, the source plugin is defined in the migration group and an error occurs if this is the case.

Steps to reproduce

Create a migration group for a migration plugin (assuming migrate tools is enabled)
Move the source configuration into the migration group under the "shared_configuration"
load the migrations and view the error.

Proposed resolution

1. Check for the `plugin` part of the migration configuration before loading the source plugin
2. Get the source plugin value from the migration group if it's available.

Interim: duplicate the plugin property into the migration configuration.

Remaining tasks

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Comments

pookmish created an issue. See original summary.

jurgenhaas’s picture

Ran into the same issue this morning after running composer update. Suddenly my plugins are not recognized anymore. As a workaround I disabled inline_entity_form_migration_plugins_alter and operations are back to normal.

spokje’s picture

Bug seems to have snuck in in commit for Added migrate support for Drupal 7 => Drupal 8. and thus is only present in 8.x-1.0-rc9

quietone’s picture

First guess is this should be $settings not $settings[], https://git.drupalcode.org/project/inline_entity_form/-/blob/8.x-1.x/src...

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new587 bytes

Per quietone's suggestion.

damienmckenna’s picture

I'm running the change locally to see if it fixes me migration problem, will report back soon.

Status: Needs review » Needs work

The last submitted patch, 5: inline_entity_form-n3208279-5.patch, failed testing. View results

damienmckenna’s picture

FWIW patch #5 fixes the problems I was seeing on a site migration.

geek-merlin’s picture

geek-merlin’s picture

spadxiii’s picture

I traced a little bit further and noticed that migrate_plus_migration_plugins_alter adds more data that is being used in the alter of inline entity form. The problem is that the hook of this module is ran before the migrate_plus hook. So the data is not present yet.

The patch in #5 did not fix the problem for me.
I resolved it by adding a module_implements_alter in which I moved the migrate_plus hook first.

pcate’s picture

I ran into this migration issue as well. It was causing all imports to fail. I needed both this patch and the one in https://www.drupal.org/project/inline_entity_form/issues/3208995 to resolve the issue.

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new1.14 KB

Combining the two patches.

Status: Needs review » Needs work

The last submitted patch, 13: inline_entity_form-n3208279-13.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

damienmckenna’s picture

FWIW the two patches together allow my migration to work.

Brian Weaver’s picture

I was also having migration issues, although they presented differently (errors below). The patch in #13 appears to have fixed it.

In SqlBase.php line 207:

  No database connection configured for source plugin premigration


In Database.php line 364:

  The specified database connection is not defined: migrate

My database connection is called "source_db" and I believe some or all of my migration groups define it as shared config.

efpapado’s picture

Status: Needs work » Reviewed & tested by the community

#13 worked fine for me. Should it be set to RTBC?

geek-merlin’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)
Related issues: +#3221074: Implemented hook_migration_plugins_alter() breaks migrations, if shared configuration used in migration configs.

Patches with failing tests are NEVER RTBC. A code review shows this is only suppressing buggy functionality.

Does the related issue fix this?

it-cru’s picture

Status: Postponed (maintainer needs more info) » Active

@geek-merlin: Patch from related issue fixed this problem for me. So I would say we could mark this issue here as a duplicate of #3221074: Implemented hook_migration_plugins_alter() breaks migrations, if shared configuration used in migration configs..

geek-merlin’s picture

Status: Active » Closed (duplicate)

Thx a lot!

> So I would say we could mark this issue here as a duplicate

Done.