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.
Reproduce: Have a default menu link exported from features with a parent that is added via hook_menu (for example) and not hook_menu_default_menu_links.
Since this doesn't test if menu item is managed by a feature.
if (!empty($link['plid']) && $parent = menu_link_load($link['plid'])) {
$link['parent_path'] = $parent['link_path'];
}
When menu_links_features_rebuild_ordered is reordering, it drops the menu item as both conditions always fail.
Patch tests and lets it catch the first if statement. Later, if the menu item exists, even if not managed by features, it sets the parent as features_menu_link_load doesn't care who made the menu link :)!.
Comment | File | Size | Author |
---|---|---|---|
#6 | features_910604_menu_parent_path.patch | 748 bytes | hefox |
#2 | features.910604.patch | 740 bytes | jhedstrom |
parent_path_fallback.patch | 916 bytes | hefox | |
Comments
Comment #1
hefox CreditAttribution: hefox commentedClarifying title
Comment #2
jhedstromThis resolves the issue for me. Re-uploading the same patch, but made with
--relative --no-prefix
so it can be applied via drush make.Comment #3
hefox CreditAttribution: hefox commentedSeems good then, marking RTBC.
(Oh damn, I've been sooo good lately about --relative --no-prefix I haven't been double checking my patches. I really need to make an alias...).
Comment #4
DamienMcKenna+1. This, and a few others, have resolved some crazy menu problems I was having. Thanks!
Comment #5
hefox CreditAttribution: hefox commentedCode in d7 looks the same
d6 commit: http://drupalcode.org/project/features.git/commit/9f4c8e4
Comment #6
hefox CreditAttribution: hefox commentedPatch applied fine, so here's one with the a/, b/ prefixes.
Comment #7
febbraro CreditAttribution: febbraro commentedComment #8
febbraro CreditAttribution: febbraro commentedI'm having difficultly testing this. Can you give me a more complete test case?
Comment #9
hefox CreditAttribution: hefox commented1) Take a menu item that is in a menu by default, like create content (node/add) in navigation.
2) Add a menu entity under that to something else ('admin/content/node'? for example)
3) export that menu link into a feature.
4) try that feature on a new site
(I think)
Comment #10
mpotter CreditAttribution: mpotter commentedClosing this for lack of activity. I know menu links have issues, but please re-open this issue if you think this patch is still needed.