Problem/Motivation
If we migrate Drupal7 menu links with Drupal core migrations, menu links aren't migrated in some cases:
- The menu link points to e.g. a views page, and that page isn't available when we execute the migration.
- The menu link we are about to migrate misses its parent menu link (e.g. because the parent menu link is a non-customized, module-provided menu link, or the parent's destination is an internal, missing page.).
It would be better to migrate menu links in these cases as well, since it is very time consuming to recreate a complex menu hierarchy by hand.
Proposed resolution
If a menu link's path fails the validation, migrate it with route:<current>, add the missing source path to the menu link's title, and change it to disabled.
If a menu link's parent is missing at the time of the migration, create a stub menu link, add its missing source path to its title, and migrate it as disabled.
For parent menu links which are missing (either because they're completely missing from the source, or because they are non-customized, module provided menu links), create a "trap" migration, and do the same as in the previous cases.
API changes
A new migmag submodule: migmag_menu_link_migrate.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | migmag-menu_link_migration-3251698-7--fix-only--do-not-test.patch | 30.95 KB | huzooka |
| #10 | migmag-menu_link_migration-3251698-10.patch | 452.71 KB | huzooka |
Comments
Comment #2
huzookaComment #3
huzookaComment #4
huzookaTitle of "trapped" menu links whose path is missing on the destination get their source path as suffix.
If the source path of a "trapped" menu link is missing (either on source or on the destination), the menu link will be disabled.
Comment #5
huzookaMainly test data cleanup.
Comment #6
huzookaFix-only patch of #5.
Comment #7
huzookaComment #8
huzookaComment #10
huzookaComment #11
huzookaComment #13
huzookaComment #14
huzookaComment #15
huzooka