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

  1. Install Migrate Tools 6.1.1 without enabling Migrate Plus.
  2. Ensure the Migrate Plus module is not installed or enabled.
  3. Navigate to /admin/structure/migrate.
  4. 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

Command icon 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

tarawij created an issue. See original summary.

tarawij’s picture

Status: Active » Needs review

A 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.

heddn’s picture

Status: Needs review » Needs work

Ideally we identify what made this hard dependency on migrate_plus in 6.1 and revert/rollback/fix that. Is that even possible?

cb_govcms made their first commit to this issue’s fork.

cb_govcms’s picture

This 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.

heddn’s picture

Issue tags: +Needs tests

Is 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.

jeremy1606 changed the visibility of the branch 3536772-add-migrate-plus-dependency to hidden.

jerech’s picture

I’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.

jerech’s picture

Status: Needs work » Needs review
selvira’s picture

Hi I tested the latest changes and it worked.
Best,

selvira’s picture

Status: Needs review » Reviewed & tested by the community

  • heddn committed b2198226 on 6.0.x authored by cb_govcms
    Issue #3536772 by cb_govcms, jeremy1606, heddn: migrate_plus dependency...
heddn’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the fixes here.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.