I am really excited about this module, I was looking for exactly this for my own installation profiles.
There is a problem I'm experiencing though, my feature containing nodes fails to promote the correct content to the homepage and it does not create menu items although these settings are in the feature's code.
I also had in instance where, after running the profile where my 'content feature module' implemented pages, the content was there but the content type 'page' was not. So the website did have page nodes, but not the content type page....
Would greatly appreciate any help or suggestions!
Update 2020
There is a new module Feature Menu UUID which adds a uuid to every menu link in the database, and then uses those for the export.
It also converts entity paths into uuid paths on export, using the uuid of the entity.
All future effort about menu links integration should go into this new module.
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | 968826-features-menu-uuid.patch | 5.2 KB | tayzlor |
| #12 | 968826-features-menu-uuid.patch | 5.17 KB | ezra-g |
| #10 | uuid_features-menu_links-968826.patch | 4.68 KB | dkingofpa |
| #9 | uuid_features-968826.patch | 2.79 KB | pearcec |
| #7 | uuid_features-968826.patch | 4.91 KB | pearcec |
Comments
Comment #1
alfthecat commentedI just found out (it completely slipped past me) that the reason for my problem is that... the node id's are not kept in tact.
So I export a node/96 in my feature module.... but it arrives as node/2. So that's why my content references and menus break down.
Changing the title, I hope this info can provide any suggestions.
Comment #2
chaps2 commentedThis module is not supposed to preserve node ids - and it wouldn't work if it did.
So although I haven't tried exporting nodes yet, i doubt this is a bug.
Comment #3
indytechcook commentedNode id's are a serial id from the node table and can not be used across multiple sites. Preservice nid's is not the answer. Perhaps exporting menu links against the UUID would be an anser.
Comment #4
alfthecat commentedThanks for the reply, what exactly do you mean by exporting menu's against the UUID? Is this different from what I'm doing now, just selecting items and nodes from the 'Menu's' , 'Menu links' and 'Content' options when creating a feature?
Comment #5
indytechcook commentedSo this module works by creating a UUID for the node using the UUID module. The UUID is unique per site, it's considered a GUID. We just need to create a patch that modifies the menu links as they are being exported, replacing the nid with a uuid for paths like 'node/[nid]'.
Comment #6
pearcec commentedThis is a show stopper for us at the moment. I think the whole point of having this in a feature is that you would expect it to link to a menu somewhere. Otherwise you just have content floating on in the abyss. I would like to help. Seems like we would have to patch the features module. It should check if uuid is being used. If so export the uuid. Then when we don the import it needs to do the translation. Doesn't sound to bad.
Comment #7
pearcec commentedI tried to work on a patch. I modified features/includes/features.menu.inc. Might not be the best approach. It works but the content needs to be in place before the menu_link can be loaded. Otherwise the feature will show that it is overridden until the menu_link can be reverted. The only way to fix this would be to make uuid_content features get loaded before menu_links.
Comment #8
pearcec commentedthis patch is broken, I was working on it late and didn't upload the correct one. Looking for it now.
Comment #9
pearcec commentedFound it.
Comment #10
dkingofpa commentedPatch from #9 with a fix so duplicate menu links aren't inadvertently created. It patches the features module.
Comment #11
ezra-g commentedThis is a patch against the Features module - Moving to the proper queue and reviewing today.
Here's some background on why I'm interested in this patch:
Goal: Export menu links that match a defined sitemap for the Conference Organizing Distribution (COD).
Challenge: We want to point to both arbitrary callbacks and Views based on their path alias. However, the nids of these node changes across sites.
For example, Looking at a slice of our primary links, we want:
/schedule (points to a node created during .install or exported by UUID Features )
/schedule/sessions (points to a view defined in a feature)
Comment #12
ezra-g commentedHere's a slight re-roll with
This conditional was preventing certain menu links from being saved. Specifically, the links that were not being saved were menu links pointing to a page view that was a child of a node+ menu link combo exported by uuid. The conditional was failing because the menu link in code refers to a parent uuid, which earlier in this function we change to the actual parent_path. Because the altered $link no longer matched the one passed in with $menu_links, it was never saved.
Note that this depends on the patch at http://drupal.org/node/860974#comment-3505484 .
Comment #13
dsnopekSubscribe
Comment #14
transmitter commentedThis patch works great!
But say .. is it possible, that it doesn't take care of the second level menu/hierachy?
Now, every node and menu link shows up for the parent pages.
Just the child pages menu links don't show up.
I tried to grasp the problem within 968826-features-menu-uuid.patch but somehow I am a bit rusty I guess :-S
Comment #15
thebuckst0p commentedsubscribe
Comment #16
scottrigby@ezra-g - #12 (& dependent patch) seems to be working like a charm. Exact same use case, for deployment.
Comment #17
ywarnier commentedsubscribe
Comment #18
scottrigbyre #12: just noticed node_get_by_uuid() is now called a few times without checking if module_exists('uuid')
Comment #19
tayzlor commentedadded module_exists() check for the one part of the patch it is needed at. re-uploading.
Comment #20
ezra-g commentedMarking as needs review per #19.
Comment #21
Matir commentedThe patch in #19 has a couple of obvious problems even before I apply it. It blindly assumes that the link_path is an internal Drupal link to a node (e.g., node/NNNN). Linking to anything else (a view, a module-generated page, an external link) would try to pull a node out of who-knows-what. Additionally, it blindly assumes that there is a $node->uuid, without checking if it exists. While the next check will catch it, this will throw a PHP warning on a node without a uuid.
Comment #22
andyf commentedsubscribe
Comment #23
hefox commentedLooked at it also and saw what 21 saw, so needs work.
Moving most major feature requests to d7; is this relavent for d7?
Comment #24
Dean Reilly commentedSubscribed
Comment #25
okokokok commentedVery relevant for D7.
Comment #26
Dean Reilly commentedI ran into this issue on a recent project and ended up coding my own solution for the 6.x branch. I've created an issue for it in the features uuid issue queue here #1283742: UUIDs for Menu Links.
My solution worked by looking for node and user auto load functions in menu router paths and switching out the arguments for their respective UUIDs.
Comment #27
gregglesSince the work so far is against 6.x it seems reasonable to leave this as 6.x unless a maintainer comments to say they want to follow the "fix in 7.x, backport" flow instead of a "fix in 6.x, forward port" flow.
Comment #28
hefox commentedThe policy for features is that feature requests cannot go directly into 6.x without going into 7.x first (unless they are irrelevant to 7.x) :/
Comment #29
gregglesNo problem - great to have that direction.
Comment #30
ygerasimov commentedI would suggest this functionality to live in uuid_features module instead of features itself.
Comment #31
imre.horjanI have written a patch for Features 2: https://www.drupal.org/node/2353585
Comment #32
donquixote commentedThis was already "fixed" in #2353585: UUID export and import of menu items linking to nodes, terms and users.
The solution that was committed is far from perfect, but it does make this old issue obsolete.
Closing as duplicate.
Comment #33
donquixote commentedAdding a link to the new Feature Menu UUID module.