Problem/Motivation
Migrate Tools 6.1.x adds routes that depend on the migration_group entity, which is defined by Migrate Plus. However, migrate_plus is not listed as a dependency. As a result, accessing /admin/structure/migrate without Migrate Plus enabled causes a fatal PluginNotFoundException. This affects both 6.1.0 and 6.1.1. Issue #3534606 fixed schema errors, but not this runtime dependency.
Steps to reproduce
- Install Migrate Tools 6.1.1 without enabling Migrate Plus.
- Ensure the Migrate Plus module is not installed or enabled.
- Navigate to
/admin/structure/migrate. -
Observe the fatal error:
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "migration_group" entity type does not exist in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 139 of core/lib/Drupal/Core/Entity/EntityTypeManager.php).
Proposed resolution
Update migrate_tools.info.yml to include the missing dependency:
dependencies: - drupal:migrate - drupal:migrate_plus
This would enforce the expected runtime environment and help prevent fatal errors when Migrate Plus is not enabled.
Remaining tasks
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Issue fork migrate_tools-3536772
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
tarawij commentedA merge request has been submitted to fix this issue:
[!92: Add migrate_plus as a required dependency](https://git.drupalcode.org/project/migrate_tools/-/merge_requests/92)
This MR updates `migrate_tools.info.yml` to declare `migrate_plus` as a required dependency.
This resolves the runtime issue observed in both 6.1.0 and 6.1.1.
Comment #4
heddnIdeally we identify what made this hard dependency on migrate_plus in 6.1 and revert/rollback/fix that. Is that even possible?
Comment #7
cb_govcms commentedThis seems to have existed since Migrate Plus was made optional in v6.
Menu links are only added if Migrate Plus exists but the routes are defined regardless. And so the "Configure" link for Migrate Tools on the extend page links to '/admin/structure/migrate' which errors when Migrate Plus is not installed.
I have created an MR which adds the dependency to the routes and thus removes the Configure link if Migrate Plus is not present.
Comment #8
heddnIs there any way to add a simple functional test for this scenario? I'm sure there is. Let's add that so this doesn't surface again.
Comment #10
jerech commentedI’ve added a functional test to cover this scenario. The new test installs migrate_tools without migrate_plus, logs in with a user that has the “administer migrations” permission, and attempts to access /admin/structure/migrate. The test ensures that the route does not trigger a fatal error (accepting 200/403/404 as valid outcomes). This should prevent regressions and confirm that the fix in !97 works as expected.
Comment #11
jerech commentedComment #12
selvira commentedHi I tested the latest changes and it worked.
Best,
Comment #13
selvira commentedComment #15
heddnThanks for the fixes here.