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.
This issue is similar to https://drupal.org/node/2220801 where I have trouble exporting url alias and pathauto settings when exporting node.
When I export node to feature, I was expecting the path and pathauto settings to also be exported along. This is not currently the case.
Attached is a patch that I wrote to patch this issue.
Feedback is greatly appreciated.
Comments
Comment #1
hckurniawan CreditAttribution: hckurniawan commentedComment #2
hckurniawan CreditAttribution: hckurniawan commentedSeems that url_alias is being duplicated when restoring feature. Marking this as "Needs work".
Comment #3
generalredneckRerolled
Comment #4
rabbitlair CreditAttribution: rabbitlair at Code Enigma commentedThe patch on #3 worked for me.
Comment #5
nvahalik CreditAttribution: nvahalik as a volunteer commentedThis patch is a good starting point, but needs some improvement on technical and formatting fronts.
The biggest problem is that it doesn't honor the value of $node->pathauto. It assumes that you want pathauto enabled, if you have the pathauto module installed and if the existing alias equals the alias that would be generated by the existing configuration. Therefore, if you happen to have the pathauto enabled but you've disabled it on the node being exported, then it could be enabled on the export. This could cause problems down the road.
Attached is a new patch that honors the setting of pathauto and fixes a couple of minor formatting issues.
Comment #7
nvahalik CreditAttribution: nvahalik as a volunteer commentedSetting to latest dev branch.
Comment #9
m.attar CreditAttribution: m.attar commentedI added a patch for module version alpha4 (adding_pathauto_alpha4_2220837-9)
Comment #11
m.attar CreditAttribution: m.attar commentedComment #12
Shashwat Purav CreditAttribution: Shashwat Purav commentedNeed help to preserve url aliases while exporting taxonomy terms using Features, UUID and UUID Features modules.
Comment #13
WorldFallz CreditAttribution: WorldFallz commentedHere's an updated patch against 7.x-1.x-dev that handles an undefined index notice as well as some code standard issues.
Comment #14
WorldFallz CreditAttribution: WorldFallz commentedNow with less unnecessary white space.
Comment #15
WorldFallz CreditAttribution: WorldFallz commentedAnd the same patch for 7.x-1.0-alpha4 for convenience.
@Shashwat Purav: use one of these patches depending on the version of uuid_features you have installed to get this functionality.
Comment #17
gumanoed CreditAttribution: gumanoed commentedI meet the same problem. When i export nodes to feature no path aliases are there :(
But patch #14 helped me!!!
You need this patch only on drupal from which you export nodes. Inport this feature with aliases works very well with standart feature_uuid module!
I made a little description of the procces of export nodes to feature with aliases (russian)
http://wiki.nntc.nnov.ru/index.php/%D0%9F%D1%80%D0%B8_%D1%8D%D0%BA%D1%81...
Comment #18
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedreroll for dev version 8/18/2016. The last one did not seem to apply to the dev version. I have done nothing else but re-roll to be included in my make file.
Comment #19
sumachaa CreditAttribution: sumachaa at TATA Consultancy Services for TATA Consultancy Services commentedthe patch is working when exporting the node, the 'features.uuid_node.inc' file is having
But when importing this is not getting updated
Comment #20
munroe_richard CreditAttribution: munroe_richard commentedI'm running into the same issue with manually generated paths. When I have a node for which I've manually generated an alias, the alias doesn't show up in the ...uuid_node.inc file generated by features. The path should be: help/earnings/earnings-status. Here's the node as generated:
I'm using the module that was released in Aug-2016. When I looked at the code in node export render, I realized that the module wasn't actually doing anything with pathauto or the alias. I applied patch 18 and I'm seeing:
in the rendered nodes which is promising. I'm going to see if things actually get the right paths when I enable the feature on another system.
And that worked as expected. The paths showed up and the manually generated path was correctly captured on the new system.
So I'm going with patch 18 until a new release of the dev module is made.
Comment #21
WorldFallz CreditAttribution: WorldFallz commentedIt would be really great if we could get this included in the next RC. Rerolled to get rid of a white space warning and kick testbot.
Comment #23
m.lebedev CreditAttribution: m.lebedev commentedHello!
I think do not need to create an array that contains the original path of the node.
I added a check that the path is not equal to the original.
Comment #24
adam3145 CreditAttribution: adam3145 commentedI have tried the patches in #21 and #18 with rc1, and neither of them are creating paths for taxonomy terms on export. Am I to use these patches on DEV or is something else going on? Using Drupal 7.54 with the RC1 release.
Comment #25
petednz CreditAttribution: petednz commentedis there an overlap with this https://www.drupal.org/node/982818#comment-10040366
Comment #26
goron CreditAttribution: goron commentedThe patch in #23 together with the patch at https://www.drupal.org/node/982818#comment-10040366 seem to provide the solution to exporting nodes successfully with alias (this patch) as well as rebuilding correctly on features revert (other issue's patch). Seems to me they should be combined and consolidated into one issue. Don't have time to do that myself at this moment, but thought it might be useful to someone else to know to use these patches together.
Comment #27
aubjr_drupal CreditAttribution: aubjr_drupal as a volunteer and commented@goron - Good idea. I've combined the two patches and am attaching it here.
UPDATE: Built the patch incorrectly. Re-uploading.
Comment #28
aubjr_drupal CreditAttribution: aubjr_drupal as a volunteer and commentedRebuilt patch from #27, which is bad.
Comment #31
aubjr_drupal CreditAttribution: aubjr_drupal as a volunteer and commentedApplied code sniffer suggested fix.
Comment #33
das-peter CreditAttribution: das-peter as a volunteer and commentedLooks good to me - Thanks :)
Committed & pushed.