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.

Comments

huzooka created an issue. See original summary.

huzooka’s picture

Status: Active » Needs work
StatusFileSize
new905.11 KB
huzooka’s picture

StatusFileSize
new912.39 KB
new14.24 KB
huzooka’s picture

StatusFileSize
new914.61 KB
new6.12 KB

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

huzooka’s picture

StatusFileSize
new414.88 KB
new7.62 KB

Mainly test data cleanup.

huzooka’s picture

Fix-only patch of #5.

huzooka’s picture

StatusFileSize
new452.69 KB
new30.95 KB
new27.46 KB
huzooka’s picture

Status: Needs work » Needs review

The last submitted patch, 7: migmag-menu_link_migration-3251698-7.patch, failed testing. View results

huzooka’s picture

Assigned: huzooka » Unassigned
StatusFileSize
new452.71 KB
new599 bytes
huzooka’s picture

  • huzooka committed 711ded4 on 1.3.x
    Issue #3251698 by huzooka: Enhanced Menu Link Migration
    
huzooka’s picture

Status: Needs review » Fixed
huzooka’s picture

Issue summary: View changes
huzooka’s picture

Component: Miscellaneous » Code

Status: Fixed » Closed (fixed)

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