I'd comment at #2947642: d6_path_redirect plugin must define the source_module property but that's now closed and since I'm not a maintainer, I can't reopen it.

The bug reported there was for D7. The patch committed added the same annotation to the sources for both the d7 and d6 migrations.

However, there was no "redirect" module for D6. The d6 annotation is wrong. It should say that the "source_module" is "path_redirect", since that's what the module was called.

I thought #2908282: Throw exception for source plugins without a source_module property and friends were supposed to throw helpful exceptions if a migration source had the wrong thing, and would warn you that the module you're looking for wasn't installed in the source DB. Nope. It all silently ignores the migration, now that the annotation is defined, but pointing to the wrong module.

When trying to migrate from D6 using 8.x-1.1 of redirect, drush ms never finds the migration.

dww@iskra% drush ms d6_path_redirect
dww@iskra%

With the following trivial patch to fix this:

index 973b3a7..3ffd4b6 100644
--- a/src/Plugin/migrate/source/PathRedirect.php
+++ b/src/Plugin/migrate/source/PathRedirect.php
@@ -9,7 +9,7 @@ use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
  *
  * @MigrateSource(
  *   id = "d6_path_redirect",
- *   source_module = "redirect"
+ *   source_module = "path_redirect"
  * )
  */
 class PathRedirect extends DrupalSqlBase {

Now, drush finds the migration:

dww@iskra% drush ms d6_path_redirect
 Group: Default (default)  Status  Total  Imported  Unprocessed  Last imported
 d6_path_redirect          Idle    2475   0         2475

And happily runs it:

dww@iskra% drush mim d6_path_redirect
Processed 2475 items (2475 created, 0 updated, 0 failed, 0 ignored) - done with 'd6_path_redirect'

I'll attach the patch in a follow-up comment once I have a nid for this issue. Stay tuned.

Comments

dww created an issue. See original summary.

dww’s picture

Status: Active » Needs review
StatusFileSize
new489 bytes

Status: Needs review » Needs work

The last submitted patch, 2: 2955400-2.d6_path_redirect-source_module.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

dww’s picture

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

FFS, that's a bogus test. There was no "redirect" in D6. The test fixture needs to "install" the "path_redirect" module.

How about this, bot?

mikelutz’s picture

Priority: Major » Normal
Status: Needs review » Reviewed & tested by the community

I can confirm this was my fault on the previous issue. I had forgotten the module name changed from 6 to 7. The fix is good.

pifagor’s picture

look good +1

heddn’s picture

Do we need a d6 fixture? That seems like a lot of extra work. Let's just merge things. +1 on RTBC.

mikelutz’s picture

@heddn It already has a fixture - stripped down to the minimum tables and data needed for tests. I had to add a systems table to that fixture originally so that it would pass the source module requirements check. I just added the table manually, and completely forgot that the module name changed between 6 and 7. The patch just updates the systems table in the fixture to use the correct d6 module name.

Completely my fault. I've been doing this long enough to have actually installed path_redirect on many sites, and I still completely spaced on the name change.

heddn’s picture

I see that now. Ignore #7.

  • Berdir committed e8423c1 on 8.x-1.x authored by dww
    Issue #2955400 by dww: d6_path_redirect has to define the *correct*...
berdir’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed.

Status: Fixed » Closed (fixed)

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