Closed (duplicate)
Project:
Drupal core
Version:
7.x-dev
Component:
locale.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
20 Sep 2008 at 17:24 UTC
Updated:
3 Nov 2010 at 08:51 UTC
Jump to comment: Most recent file
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 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 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 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 commentedComment #14
mrbuom commentedComment #15
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 commentedMrbuom's patch (#14) works perfectly, thanks!
Comment #17
alienzed commented#14: awesome, thanx
Comment #18
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