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.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 2955400-4.d6_path_redirect-source_module.patch | 1.75 KB | dww |
Comments
Comment #2
dwwComment #4
dwwFFS, 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?
Comment #5
mikelutzI 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.
Comment #6
pifagor commentedlook good +1
Comment #7
heddnDo we need a d6 fixture? That seems like a lot of extra work. Let's just merge things. +1 on RTBC.
Comment #8
mikelutz@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.
Comment #9
heddnI see that now. Ignore #7.
Comment #11
berdirThanks, committed.