Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
translation.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
28 Dec 2010 at 05:13 UTC
Updated:
3 Jan 2014 at 02:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
plachWould you please describe more completely the steps to reproduce this error? Also a list of the enabled modules would help.
Comment #2
tsvenson commentedOki, will try.
The site I am building will in the future be multilingual, but start with only English. Therefore I have enabled the Content translation and Locale modules so that I can set the content to English instead of Language neutral.
I have just reproduced this on a clean Drupal 7 RC3 by doing the following:
- Install with Standard profile
- Change Basic Page CT to Multilingual with translation
- Create a new Basic Page with menu
- Click the Translate button.
Then you should get the same error as in the original post.
I then tested by adding a second language, Swedish in my case. This time I didn't get the error. Thus it only seems to appear when only one language exists.
This is not a big problem since the error doesn't cause any problems and in my case only the administrator role will see the Translate button, at least until a second language is added.
Still, Drupal should be able to catch this since this is the only way I can set the language for a node. At least as far as I know.
Comment #3
plachOk, reproduced. The attached patch should fix the issue.
Comment #4
plachComment #6
plach#3: translation-1008628-3.patch queued for re-testing.
Comment #8
plach#3: translation-1008628-3.patch queued for re-testing.
Comment #9
sivaji_ganesh_jojodae commentedNot sure whether this will really fix it but you need to use module_load_include() to add inc file.
http://api.drupal.org/api/drupal/includes--module.inc/function/module_lo...
Comment #10
plachmodule_load_include does not work with includes not belonging to modules
Comment #11
sivaji_ganesh_jojodae commentedI followed the instructions in #2. It works good for me, could not reproduce any bug.
Comment #12
plach@sivaji:
I was able to reproduce it: the error happens because
language.incis included only if at least two languages are enabled, hence if one access the translation page and there is only one language enabledlanguage_negotiation_get_switch_links()won't be defined.Comment #13
plachHere is a simpletest that shows the issue. The test-only patch is supposed to fail to prove that the full patch correctly captures the bug. If the bot agrees this should be ready to go.
Comment #15
plachOk, someone please RTBC this.
Comment #16
marcingy commentedThis patch makes sense.
Comment #17
les limThis appears to have been committed earlier today: http://drupal.org/cvs?commit=472224