Closed (duplicate)
Project:
Features
Version:
7.x-1.0-beta6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Mar 2012 at 15:23 UTC
Updated:
14 Mar 2012 at 17:41 UTC
When I try to add certain user created menu links to a feature I can't I used the following process below. I don't understand how some menu links are exportable and others aren't even if they are all created the same way. Out of the two new menus I created I could only 1 link from each menu to the feature there are more than two links in the menus.
1. Create 2 new menus
2. Add menus to a feature
3. Add links to both menus (all pointing to <front> with various different titles)
4. Attempt to add menu links to existing feature
5. FAIL
Comments
Comment #1
mikebell_ commentedLooks like when it generates the list of exportable menu links it's only taking the last items even though there are more available.
Comment #2
hefox commentedYou're missing a word here
Comment #2.0
hefox commentedfixing
Comment #3
mikebell_ commentedFixed now I've had chance to calm down a bit, spend far too long messing around with my broken features trying to fix stuff that isn't going to work.
Easy steps to re-create:
1. Create new menu
2. Add 3 links (test 1, test 2, test 3), point them all to front
3. Create new feature, only test 3 link will be exportable (no need to save the feature)
4. Re-order new menu so test 2 is last in the list
5. Create new feature, only test 2 link will be exportable
I'll take a look through the code and see if I can patch it myself.
Comment #4
mikebell_ commentedGot to the bottom of it.
When features builds up the array of $options in menu_links_features_export_options() it uses the $identifier as key for the array, this is generated from menu_links_features_identifier(). Since the menu name and the menu link path are the same in this case the $identifier will always be the same overwriting anything pre-existing in the $options array.
Simple you can't export multiple menu items that point to the same path in the same menu. Our use case for this is to create a dummy menu that can be used for theming purposes quickly and easily.
I'm pretty sure rebuilding how menu_links_features_identifier() works would break backwards compatibility. I'll leave this open in case anyone can offer a solution.
Comment #5
hefox commentedFigured it was this issue #927566: Add link title to menu link identifiers to make them more unique.
Comment #5.0
hefox commentedfixed code formatting.