Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
when a multilingual support is disabled for given node type, then a saved node should not have language set in {node} nor in {url_alias} table, it should be saved with language = NULL
the problem is that some links will not show the url alias but shows the internal link, because the url alias does not exists for the actual language.. so I have to change the language manually for these nodes..
Comment | File | Size | Author |
---|---|---|---|
#14 | locale.module.patch | 870 bytes | mrbuom |
#2 | 311158_node_language.patch | 1.48 KB | Pasqualle |
Comments
Comment #1
Pasquallethe problem is in locale_form_alter() function with this code snippet
Comment #2
Pasquallealso changed the default language for multilingual nodes, because that should not default to Language neutral.
Comment #3
brucepearson CreditAttribution: brucepearson commentedThe patch doesn't work for me, it still sets the language selector to "Language neutral".
When the locale_form_alter is called $form['#node']->language is set to an empty string.
Maybe change:
to
Comment #4
PasqualleI see, that is a problem.
But I think your modification changes the node language even when you edit it, not only at node creation. Can you confirm that when you open a node for edit which is "Language neutral", it changes to default language automatically? That should be wrong also..
Comment #5
brucepearson CreditAttribution: brucepearson commentedyou are right - my modification wont work when you edit a node that is "Language neutral".
Maybe it would be better to just see if we are editing a node then and set the default language only if it is a new node.
We can check for the nid:
Comment #6
Pasquallethat smells like a little hack to me :) The code should be easily readable. You are mixing two things here, at least it should be changed to an if statement with an explanation written in the code comment.
note: the
isset($form['#node']->language)
is used to avoid php notices, and possible problems. (although I do not know now, how could that isset() return false)Comment #7
Pasquallebut the good solution would be to not set the node language outside the locale module. I do not understand why it is set to an empty string.
Comment #8
PasqualleComment #9
brucepearson CreditAttribution: brucepearson commentedIt looks like it is being set in the node module, node.pages.inc, function node_add
Comment #10
plachsubscribe
Comment #11
Pasquallethe node.module uses the node language property, and it would be hard to remove. So I am fine with the isset($form['#node']->nid) check, just the code needs to be more readable..
Comment #12
Pasqualle#258785: Provide more flexible settings for initial language on content types
Comment #13
mrbuom CreditAttribution: mrbuom commentedComment #14
mrbuom CreditAttribution: mrbuom commentedComment #15
cronix CreditAttribution: cronix commentedI am looking for something similar. I have made a vocabulary with language specific terms. This vocabulary is used in my forum. That way I have have a multi lingual forum because the forum page will only show the terms in the current site language. That is working perfectly. My issue is that the forum posts are posted language neutral and not in the current site language. Has anyone found a solution for that? I am using D6.12
Comment #16
smartmark CreditAttribution: smartmark commentedMrbuom's patch (#14) works perfectly, thanks!
Comment #17
alienzed CreditAttribution: alienzed commented#14: awesome, thanx
Comment #18
boran CreditAttribution: boran commented#14 worked fine for me on D6.14 too.
A pity core has to be hacked and this fixed has not been included in core over the last few months..
There is also a thread on removing "Language neutral", that was also needed for my multi-language form site, perhaps it interests other readers: http://drupal.org/node/250891