Closed (duplicate)
Project:
Menu Position
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
4 May 2011 at 02:02 UTC
Updated:
22 Mar 2016 at 15:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Shadlington commented+1
Comment #2
vectoroc commented+2
Comment #3
mstrelan commentedI've never integrated with Features before but it seems like it should be pretty easy using the CTools Export API. Here's what I've got so far.
Allow rules to be exported using Features.
This is all well and good for exporting a rule, although it should really save machine names.
I have no idea how to get the rules to import when you enable the feature. Executing this PHP seems to do the trick though.
Comment #4
acbramley commentedsub
Comment #5
crashtest_ commentedHere is a big start on making this features-able.
There is an issue, #1001538: Provide CRUD functions for menu position rule sets, which will be about getting crud features into menu_position, and this issue will need to use that groundwork when it is complete.
Currently this patch will export a feature, and setup the schema (including updating current db's). It will not work correctly for updating on different machines and evaluating between code and db, as the crud features aren't in place. It's a start though.
Comment #6
dave reidBetter title. See also: #1281012: Proposing a 2.x branch (and co-maintainer application)
Comment #7
johnalbinMoving to 7.x-2.x.
Comment #8
johnalbinBefore calling ctools_export_load_object(), you need to this first:
Comment #9
bforchhammer commentedAny news on this issue? Is this still waiting on co-maintainership for Dave Reid and CrashTest_?
Comment #10
zhgenti commentedIt would be really great if you guys could add this feature.
Comment #11
mattiasj commentedWould love too see this as well. Menu position is an important feature for almost any site produced.
Comment #12
BarisW commentedJohn, do you need any help here? What's the status?
Comment #13
phayes commentedI'm going to be taking a crack at this.
Comment #14
phayes commentedUgh,
I just realized a major problem with the whole idea of making menu-position rules exportable. Menu position rules need to reference a "parent" menu-link item, but Drupal does not provide an exportable machine-name for menu links. All menu-links are merely ID'ed using auto-incrementing INTs. So actually "referencing" a menu-link, and expecting it to work across sites where we've also exported the menu using features, isn't going to work.
Anyone have any thoughts on this?
Comment #15
mraichelson commentedUUID has some code in it that will add something more unique to menu links for exporting to features. Might be worth taking a look at.
Comment #16
socialnicheguru commentedthere is also defaultconfig which might be helpful
Comment #17
socialnicheguru commentedI got the following when I applied the patch:
Warning: unserialize() expects parameter 1 to be string, array given in menu_position_evaluate_rules() (line 284 of modules/all/menu_position/menu_position.module).
Warning: Invalid argument supplied for foreach() in menu_position_evaluate_rules() (line 285 of /menu_position/menu_position.module).
Comment #18
pvhee commentedAny progress on this issue since 2012?
Comment #19
netsensei commented#14 is right. Without proper uuid support, exporting/importing menu position rules is going to be quite the exercise.
I would recommend postponing this to a 8.x branch. Why?
1. Because the core menu_link module in D8 (and, by extent, entities in D8 in general) supports UUID's of the box.
See: https://api.drupal.org/api/drupal/core%21modules%21menu_link%21menu_link...
2. Because relying on UUID from contrib would introduce another dependency which needs to be maintained.
Comment #20
WS_vanessa commentedsubscribe
Comment #21
jmking commented@netsensei - this could be created as a sub-module. That's what most modules do that do not want to enforce a dependency on UUID, but still want to offer features compatibility.
Comment #22
antondavidsen commentedSee https://www.drupal.org/node/2368121
Comment #23
joachim commentedClosing as a duplicate.