Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Create a set of migration files to enable users to migrate Drupal 7 Menu & Menu Links - ignoring system menus and system menu links
Comment | File | Size | Author |
---|---|---|---|
#31 | 2382985-31.patch | 22.38 KB | phenaproxima |
#28 | 2382985-28.patch | 25.87 KB | phenaproxima |
#28 | interdiff-2382985-26-28.txt | 1.91 KB | phenaproxima |
#26 | 2382985-26.patch | 24.42 KB | phenaproxima |
#25 | 2382985-24.patch | 35.22 KB | quietone |
Comments
Comment #1
-enzo- CreditAttribution: -enzo- commentedI did a migration files to enable users to migrate menus and menu links from Drupal 7 to Drupal 8.
Is probable you are a Migration Exception error migration in you custom menu links Array index missing, extraction failed. sadly this message is not to mucho helpful about where is the problem.
After debug I determine the problem is located in process function of field options in D7 -> description in D8 the login require a strict multidimensional array in options field like this
To resolve this issue I did a script to be executed via Drush
The script will create the required entries attributes or title inside attributes if doesn't exist. so your Drupal 7 will continue working and will be able to be migrated to Drupal 8
Comment #2
benjy CreditAttribution: benjy at CodeDrop commentedComment #3
benjy CreditAttribution: benjy at CodeDrop commentedComment #4
Greg BoggsAnyone know how to disable this migration when using the migration_UI to prevent it from causing fatal error the migration?
Comment #5
benjy CreditAttribution: benjy at CodeDrop commentedThese migrations aren't in core, did you apply this patch manually? If so, just remove it.
I'm pretty sure the UI try's to detect the version you're running and then runs all migrations with that label, you could just remove this migration from your active store, or change the label should do it.
Comment #6
Greg BoggsI get the same error in d6 link migration. How do I remove a migration from the active store? It's possible, I'm on the wrong issue even though the error message is the same.
To clarify, I did not apply this patch. This happens every time I run migrate UI for d6.
Comment #7
benjy CreditAttribution: benjy at CodeDrop commentedSounds like you have a more general problem, might be best to create an issue on http://drupal.stackexchange.com/
Comment #8
phenaproximaRerolled for 8.0.x HEAD and added tests. Since the menu_custom and menu_links tables are identical between D6 and D7, I also moved those source plugins out of version-specific namespaces.
That said, this is blocked by #2495755: Create MigrateDrupal7TestBase.
Comment #9
phenaproximaComment #11
phenaproximaComment #14
quietone CreditAttribution: quietone commentedMostly rerolled. MigrateMenuLinkTest for 7 will fail, complaining that skip_process_on_empty plugin doesn't exist. Let's see if testbot finds any other errors.
Comment #16
quietone CreditAttribution: quietone commentedAdd 'method: process' to d7_menu_links.yml
Not yet sure why d6\MigrateMenuLinkTest fails.
Comment #17
quietone CreditAttribution: quietone commentedComment #21
quietone CreditAttribution: quietone commentedIt was just one assertion, and the order of the array was changed. It is now reverted to the original.
Comment #22
quietone CreditAttribution: quietone commentedTwo of the files in this patch contain 2 classes each, which contradicts PSR-4 namespaces and autoloading in Drupal 8 which states "Each PHP class, interface, or trait lives in a separate PHP file".
The two file are system/tests/src/Unit/Plugin/migrate/source/MenuTest.php and menu_link_content/tests/src/Unit/Plugin/migrate/source/MenuLinkSourceTest.php.
Have I got that right and this needs to be changed?
Comment #23
phenaproximaTests seem to be the exception to that rule. It's OK for test files to have more than one class, as long as that second class is a test-only double of the class being tested.
EDIT: After looking at the patch, you can actually remove both of those extra test classes. They are relics from a previous generation of testing and are no longer needed :)
Comment #24
quietone CreditAttribution: quietone commentedYea, I should have checked if those test classes were needed.
Comment #25
quietone CreditAttribution: quietone commentedRemove 'use statements' that NetBeans shows are unused. Passes test locally.
Comment #26
phenaproximaMerged the d6_menu and d7_menu migrations and did a bit of refactoring, removing some extraneous code.
Also escalating this to Migrate critical because menu links are going to be missed if they don't show up for people, and other migrations (like #2500513: Upgrade path for Shortcut 7.x) may depend on them.
Comment #28
phenaproximaFixing the test failures.
Comment #29
benjy CreditAttribution: benjy commentedCool, git shows the diff between the file you copied from
Are all the changes in this file intended?
Comment #30
benjy CreditAttribution: benjy commentedAnd this one should be in the migrate schema file, not the migrate_drupal one?
EDIT: Actually, not sure we need it at all anymore.
Comment #31
phenaproxima#29.2: No, they weren't. Fixed in this patch.
Comment #32
ultimikeI went through this with phenapromixa over my shoulder - assuming the testbot agrees, this looks good to go.
-mike
Comment #33
phenaproximaComment #34
webchickThe goofy stuff Git's doing here makes this diff a lot harder to understand than it needs to be. Basically:
Code reuse FTW!
Committed and pushed to 8.0.x. Thanks!