On path_nodeapi('update')
reuse the current path alias language, don't override it with the node content language.
Other modules may have changed the path alias language, for example to enable the alias for all defined languages.
I need this because I use the patch in #321848: How to make pathalias enable alias for all languages? with pathauto, which enables the aliases for all defined languages by removing the language alltogether, but path_nodeapi
is resetting the language to the node content one at every node update.
At first I thought the problem was in my patch or in pathauto, but then I traced the probem to path_nodeapi('update')
which is called before the pathauto_nodeapi('update')
every time and overrides what the latter did on node creation.
Regards,
Antonio
Comment | File | Size | Author |
---|---|---|---|
#11 | 0001-541802-by-ao2-Let-path_nodeapi-reuse-the-current-pat.patch | 1.03 KB | marvil07 |
path_nodeapi_update_dont_override_current_language-d6.patch | 1.26 KB | ao2 | |
Comments
Comment #1
ao2 CreditAttribution: ao2 commentedPing.
I have been using this for months. Am I the only one who needs that the alias language is preserved on update?
Any suggestion about a better way to fix this?
Thanks,
Antonio
Comment #2
gagarine CreditAttribution: gagarine commentedYou are not alone ;)
Related #347265: URL aliases not working for content not in default language
Comment #3
Robin van Emden CreditAttribution: Robin van Emden commentedMost certainly not alone. See also #321848: How to make pathalias enable alias for all languages?. The failure of path to preserve language in aliases is a major headache. This patch is sorely needed. Patch reviewed and tested, works in 6.16.
Comment #4
Gábor HojtsyFixes are first committed to Drupal 7, so let's ensure we have a fix there first or that it does not apply there.
Comment #5
klonosthanx ao2. works great!
Comment #6
pfx CreditAttribution: pfx commentedOk ao2,
This pacth what works fine in conjunction with the pacth (#321848: How to make pathalias enable alias for all languages?) with which it is necessary.
big thanks
[ Note I had to manually apply this patch to drupal 6.16:
pfx@pfx-laptop:~/drupal-6/modules/path$ patch -p0 < path_nodeapi_update_dont_override_current_language-d6.patch
patching file modules/path/path.module
Hunk #1 FAILED at 162.
1 out of 1 hunk FAILED -- saving rejects to file modules/path/path.module.rej ]
Comment #7
marvil07 CreditAttribution: marvil07 commentedsubscribing
Comment #8
das-peter CreditAttribution: das-peter commentedsubscribing
Comment #9
GoofyX CreditAttribution: GoofyX commentedSubscribing...
Comment #10
Dries CreditAttribution: Dries commentedPatch has tabs.
Comment #11
marvil07 CreditAttribution: marvil07 commentedHere the patch for D7, but now that related patch on pathauto #321848: How to make pathalias enable alias for all languages? is marked as won't fix, I am not sure if we want this.
IMHO the problem is:
- If we decide to apply the patch, we end up making impossible to change the path language on update, that means that if a user change the language of a node, the path associated is not changing neither; and that means a broken alias for that node until the language is chnaged again to the original one.
- If we decide to not adding this, that I am not inclining to think that is not a bug, we can not support the workflow as required for making one URL for all languages in pathauto.
So, I would suggest to mark this as won't fix, and for the pathauto problem we should think in other way :-/
PS: I'm not changing status to get some feedback.
Comment #12
klonosI know that according to this decision/announcement the pathauto team rejected the idea of #321848: How to make pathalias enable alias for all languages?, but -as Dave has pointed- this is only because the feature is not in the module's scope. This doesn't mean that it is not a valid feature request that is required in order to solve a very crucial issue that people with multilanguage sites face though. It might be done in a submodule or a different project, but whatever is chosen surely needs the grounds for achieving the goal. So, this definitely needs to be implemented in core.
I hear you on this one Marco. I completely understand your concern, but I believe that the (sub)module that will bring #321848: How to make pathalias enable alias for all languages? to life will somehow be able to have a mechanism to allow/control this behavior through a setting (some 'Allow same alias for all languages' checkbox). Perhaps this could be a per-content type or a global site-wide setting. Now, as for this:
...the title of this issue says 'Let path_nodeapi reuse...' not 'Force path_nodeapi reuse...', so I guess that the goal here is to allow a different behavior without breaking things from how they used to work. Perhaps the patch in its current implementation doesn't do that, but we are in the right path. We have the 'old' way working (without the patch here) and we did figure a way to successfully 'override' that behavior. Now we need to get them to work together/in parallel. I am not saying this is a walk in the park. I understand that *a lot* of work will be required for this to finally be implemented in the proper way, but in the end we'll have a solution. I am confident.
Comment #13
ao2 CreditAttribution: ao2 commented@marvil07, thanks for porting the change to D7, I haven't had a chance to took at it yet.
And your observation about a node changing language is a good one, I didn't consider that because it is a rare event, but it can still happen, so we'd better support that.
Maybe we could just check when the alias is enabled for "All languages" and keep it it that way for this case only, continuing to update the alias language to the node language for actual alias languages.
Something like (not tested, just for illustration):
But I have to think that a little more.
About the won't fix mark in pathauto, well, I think we should try to convince pathauto maintainers to revert it, that task really belongs to pathauto IMHO.
Regards,
Antonio
Comment #14
ao2 CreditAttribution: ao2 as a volunteer commentedClosing as "won't fix".
For the use case of having language neutral paths in D7, use the Neutral paths module.