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.
Features integration
Integrate with features api to allow export of menu position rules.
Comments
Comment #1
antondavidsen CreditAttribution: antondavidsen commentedComment #2
kmajzlik CreditAttribution: kmajzlik commentedDoes not work for me because i have update 7102 already in code...
Comment #3
reaperdk@boss CreditAttribution: reaperdk@boss commentedHi guys!
@karlos007
You can use command below to perform update 7101:
drush eval "require('sites/all/modules/contrib/menu_position/menu_position.install'); menu_position_update_7101();"
@antondavidsen
Your patch is working great, thank you!
Comment #4
reaperdk@boss CreditAttribution: reaperdk@boss commentedUnfortunately there is one bug. When you export rules, delete and create one entry with that same rule name then after reverting module an error will occur. It is because in
_menu_position_save_field()
function condition should be uniquemachine_name
, notrid
(which will be incremented for new entry).Comment #5
sam.spinoy@gmail.com CreditAttribution: sam.spinoy@gmail.com commentedBoth patches don't work properly, one should be able to run them against the latest dev version.
First patch doesn't work because, like karlos007 says, it uses an update hook lower than the one already in code.
Second patch fails when I try to apply it via drush.
Comment #6
reaperdk@boss CreditAttribution: reaperdk@boss commentedSecond update may fail for you because of different paths. I fixed paths in this latest patch.
Still this command is needed.
drush eval "require('sites/all/modules/contrib/menu_position/menu_position.install'); menu_position_update_7101();
This number of update was omitted when update 7102 was created, that's why now it is used.
@samspinoy
This fix works great for me. Please let me know, if you still have a problem.
Comment #7
reaperdk@boss CreditAttribution: reaperdk@boss commentedComment #8
sam.spinoy@gmail.com CreditAttribution: sam.spinoy@gmail.com commentedWhy don't you just use 7103, not everyone will know how to use drush.
Comment #9
reaperdk@boss CreditAttribution: reaperdk@boss commentedYou're right that not everyone will know how to use drush and not everyone will notice that some manual action will be needed.
In latest patch I changed update number 7103.
Comment #10
reaperdk@boss CreditAttribution: reaperdk@boss commentedDo not use patch #9. There are incorrect paths.
Comment #11
Tomáš Fejfar CreditAttribution: Tomáš Fejfar commentedI tried to apply the #10 patch. Works fine on my machine. I can create feature, feature is transferred and the rule is created on the other machine. Except it does not work afterwards. When we tried to re-save it (just in case), we're getting:
The rule uses "content-type: news | taxonomy: site-area | taxonomy value: site-1". I checked that the module is enabled, the rule is created, the taxonomy we're using is there (same ID even).
The feature itself exports:
Comment #12
joep.hendrix CreditAttribution: joep.hendrix commentedIt would be great if we could get this going.
Any news on this?
Comment #13
vinmassaro CreditAttribution: vinmassaro commented@joep.hendrix: Please see the patch in #10 - can you test it out and provide any feedback?
Comment #14
MustangGB CreditAttribution: MustangGB commented#10 worked for me and fixed my feature not being able to revert.
Comment #15
BarisW CreditAttribution: BarisW as a volunteer commentedThanks all for the groundworks. I've used a lot of the code, but rewrote large chunks of it.
Main changes:
Comment #17
BarisW CreditAttribution: BarisW as a volunteer commentedAlso, I fixed reverting the feature, since this didn't work. Thanks again! Committed.