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 is related to #383688: path not being set
Node paths are not being maintained on imported content when the PathAuto module is enabled, even with the option "Reset URL path" disabled in the settings.
I'll try to get a patch submitted a later tonight.
Comment | File | Size | Author |
---|---|---|---|
#7 | node_export-maintain-pathauto-2.patch | 828 bytes | danielb |
#5 | node_export-maintain-pathauto-1.patch | 815 bytes | danielb |
#2 | node_export-930114.patch | 896 bytes | shawn_smiley |
Comments
Comment #1
danielb CreditAttribution: danielb commentedUnfortunately I cannot identify the problem from the information given. If you can supply that patch or explain how Node Export is doing something incorrectly, please reopen the issue.
Comment #2
shawn_smiley CreditAttribution: shawn_smiley commentedSorry about the vagueness of my report.
Here are the details on how to reproduce the issue:
Environment:
Drupal 6.19
node_export 2.x-dev
pathauto 1.5
token 1.15
Steps to reproduce
Results
All imported nodes have their URL alias's cleared and regenerated using the new pathauto alias rules regardless of the "Clear URLs" setting on the configuration screen.
The expected result was that the nodes would keep their original paths after the import.
Fix
I've attached a patch that adds the property "pathauto_perform_alias=FALSE" to the node being imported if the option "Reset Path" on the configuration screen is not set.
Comment #3
sunVarious coding style issues, see http://drupal.org/coding-standards
Additionally, this seems to affect bulk exports/imports only?
Powered by Dreditor.
Comment #4
Paul_Gregory CreditAttribution: Paul_Gregory commentedI was having the same problem with a clean Drupal install. I applied the patch from #3 which seems to have solved the problem. Good work Shawn_Smiley!
Comment #5
danielb CreditAttribution: danielb commentedTry this one, It should be the same logic but in a different place where it will affect all imports.
I don't like to hack in support for contrib modules, but pathauto not being in core is surely a clerical oversight.
Comment #6
sunNo space between else and if.
Either the comment should state "Retain" instead of "Maintain", or FALSE should be TRUE (the latter being unlikely).
Powered by Dreditor.
Comment #7
danielb CreditAttribution: danielb commentedThanks sun - gets confusing working on various projects with different standards! I've made the comment clearer, and corrected the else if.
Comment #8
danielb CreditAttribution: danielb commentedComment #9
Paul_Gregory CreditAttribution: Paul_Gregory commentedI tested the patch from #7 in a clean 6.x-2.x-dev and it works nicely.
Comment #10
sun@danielb: Exactly for this reason, there is only one standard in Drupal: http://drupal.org/coding-standards
Thanks! Didn't test, but the patch makes sense now.
Comment #11
shawn_smiley CreditAttribution: shawn_smiley commentedThanks danielb and everyone else. I'm embarrassed by the non-standards code. Sorry about that.
Comment #12
danielb CreditAttribution: danielb commented@sun No, I meant projects other than Drupal, particularly PHP stuff at work. And even with drupal, 3+ years ago when I actually learnt how to create drupal modules; the standards and typical coding practices in the tutorials and modules I learnt from were a little different. Not to mention my head is filled with other programming languages that look similar and it all gets a bit muddled up at times.
Comment #13
danielb CreditAttribution: danielb commented