Hey guys, haven't actually used this myself, but others on my team are running into a few fringe-cases while trying to use it with features. To explain, features requires and expects that all menu entry paths will be unique. Therefore, having a bunch of entries with "" makes export fail.
Would it be possible to allow "nolink" to be followed by something that can be unique? Like "" or something like that. We've only run into this with features, but I can imagine it might be an issue elsewhere, as I can easily imagine another module assuming that paths will be unique (since they usually are). If we could add some bit of uniqueness after, this would offer a workaround for folks.
Due to a number of other issues, we're actually abandoning our "hardline" feature approach, so we don't need to solve this, but just wanted to give a heads up.
Cheers!
Comment | File | Size | Author |
---|---|---|---|
#18 | special_menu_items-features_compat-1355088-18.patch | 6.03 KB | ciss |
Comments
Comment #1
gagarine CreditAttribution: gagarine commentedInteresting... But I think this have to be solved outside this module. See #1283742: UUIDs for Menu Links.
I keep this open, perhaps someone is going to arrive with a great idea.
Comment #2
patcon CreditAttribution: patcon commentedThanks for considering :)
But don't be misled by that single post with an apparent solution. I added something myself, directing that person to the features issue queues, where menus are an ongoing discsussion. It's been awhile since I was following, but for whatever reason, it's hard to get a solid uuid solution with menus (something about how very little associated data is guaranteed to be both persistent and unique? I forget)
Anyhow, I don't believe it's resolved by any stretch. Cheers!
PS - Oh, and the suggestion that was lost by my filter unsuaveness was [nolink#hot_shit_uniqueness] or somthing of that nature :)
Comment #3
JurriaanRoelofs CreditAttribution: JurriaanRoelofs commentedHi, thanks for this cool module. This should really be in core because having <nolink> parent menu items in dropdown menus is the best way to make dropdown menus touchscreen friendly.
With this patch you can add arguments to the path, like <nolink>/27 or <nolink>/myblog or whatever, thus allowing for unique menu links. I tested this to work with UUID menu exportables and Im sure it will work with the regular features-native menu exports as well.
Please let me know if you're going to commit this to the module because then I'll be able to use the contrib module in my distributions, which I always prefer over custom(ized) modules.
Comment #4
gagarine CreditAttribution: gagarine commentedThanks for the patch. But I don't like you have to manually add /27 . Because you have to remember with number you use or not... -> bad UX.
I think it would be better to automatically create a hash if it's possible. We can even hide it from the user (or like fore node type, it's automatic but you can edit it if you want).
If we arrive to make good UX without ugly hack, I will definitely add this feature.
Comment #5
windmaomao CreditAttribution: windmaomao commentedwithout feature, how do we deploy our site ?
Comment #6
acrollet CreditAttribution: acrollet commentedAttached patch implements what I think gagarine was shooting for in #4. All nolink/separator links are stored with a unique path appended, but displayed as /, without the user needing to input or remember unique paths.
Comment #7
gagarine CreditAttribution: gagarine commentedI like #6. Sadly, I don't have time to make extensive test. Specially, I was not able to tell by scanning the code if we do need an upgrade path.
So if some peoples can review this patch I will be happy to commit it.
Comment #8
dema501 CreditAttribution: dema501 commented#6 works for me but i replaced
because path '<nolink>' won't work, only '<nolink>/blahblah' works fine after patching
Comment #9
bc CreditAttribution: bc commentedfor my own convenience and hopefully others' as well, i'll post a patch patched with dema501's fix in #8
it works well for me. it'd be great for this to be included in 7.x-2.x!
Comment #10
bc CreditAttribution: bc commentedinterdiff, because i just learned how to do it :)
Comment #11
bc CreditAttribution: bc commentedAfter testing the feature creation and enable from scratch, I've found that the above patch doesn't work. I don't know what exactly the problem is, and I need to stop work on this for now.
I tested with both the 1.x and 2.x branches of features, to boot. Not using uuid, though.
Comment #12
FMB CreditAttribution: FMB commentedThis patch (#9) works beautifully. bc: what might confuse you is that the path argument is not shown in the UI, it is only kept in the database.
Comment #13
ciss CreditAttribution: ciss commentedJust from glancing over the patch I can see that there are several places to improve it, e.g. using named sub patterns and lazy matching.
Comment #14
ciss CreditAttribution: ciss commentedThis patch moves the path check into a separate function and does some general cleanup. Compared to the earlier patch there are no huge functional changes, but the code should be more maintainable now.
I successfully ran a feature export and import of nolink items using this patch.
Comment #15
rooby CreditAttribution: rooby commentedI don't think this should be addressed in this module.
It is a features module bug and it makes this module more complex to hack around it.
This is the real issue #927566: Add link title to menu link identifiers to make them more unique..
There are almost certainly other modules out there that have this same issue and you can also get yourself in this spot without even using a menu item customisation module, so it is best this be fixed properly in features instead of a bunch of different ways across a bunch of different modules.
I would recommend closing this as duplciate/won't fix but I'll leave that to the maintainer.
Comment #16
DamienMcKennaMarking this as 'postponed' until Features fixes its menu items bug.
Comment #17
ciss CreditAttribution: ciss at yousign GmbH commentedUntested reroll of #14 against 2.x HEAD (46955e1b, 2015-05-12). Leaving issue postponed.
Comment #18
ciss CreditAttribution: ciss at yousign GmbH commentedAnother reroll of #14 against HEAD (69502551).