Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
translation.module
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
18 Jan 2012 at 04:00 UTC
Updated:
5 Jul 2012 at 20:37 UTC
Jump to comment: Most recent file
Comments
Comment #1
c31ck commentedAlthough I'm unable to reproduce the fatal error, the current code in translation.module is indeed not correct. The language switch links get themed by theme_links() and theme_links() expects an array for the class value.
Comment #2
c31ck commentedSetting status to needs review.
Comment #4
c31ck commentedTests are probably using the CSS classes. Since attribues['class'] is now an array, some links will get an extra 'language-link' class. I'll look into that.
Comment #5
kafitz commentedI have the same problem as described.
I think that Patch 1408636-translation-attributes-class-array-1.patch is a good patch. c31ck has described that the patch failed testing because attributes['class'] is now an array. Following code in translations.test triggers the failures:
$xpath = '//div[contains(@class, :type)]//span[@class="locale-untranslated"]';Comment #6
swentel commentedTrying this one, passes tests locally fine.
Comment #7
c31ck commentedYes, that one will probably pass the tests, but it doesn't respect any classes that have already been set on the link. Is that the behaviour we want here?
Comment #8
swentel commentedHmm, you're right, let me try again locally.
Comment #9
swentel commentedOk, better patch + test fixing
Comment #10
mr.baileysSince we no longer replace all classes with "locale-untranslated", but rather add it as an additional class, this could still fail if classes other than language-link are added, no?
What about
-18 days to next Drupal core point release.
Comment #11
swentel commentedAbsolutely right, better patch.
Comment #12
c31ck commentedLooks great. Setting to RTBC based on #5, #10 and my own review.
Adding a D7 patch.
Comment #13
dries commentedI agree that this is a bug. Committed to 8.x. Moving to 7.x for backporting.
Comment #14
c31ck commentedPatch for D7.
Comment #15
rar9 commentedPatch #14 also works for 7.12 :-)
Comment #16
C. Lee commented#14 works. Considering the simplicity of the patch, it seems safe to mark it as reviewed.
Comment #17
vasikei can confirm both : the bug and the solution #14.
Comment #18
webflo commented#14 works fine. Please commit this patch. Related issue in i18n issue queue: #1406594: Fatal error: [] operator not supported for strings in includes/common.inc on line 2320.
Comment #19
webchickCommitted and pushed to 7.x. Thanks!
Comment #20
xjm#1450298: Error locale-untranslated in translation module / hook language_switch_links_alter was marked as a duplicate of this issue.
Comment #21
batigol commentedThx guys ! A hour ago this error hit me. Good to know it's ALREADY fixed :)
Comment #23
husumiao-1 commentedIt's cool. 1408636-9.patch is worked.
Comment #24
gunwald commentedI get the same error on all user pages for anonymous users:
»user«,
»user/register«, etc
I applied the patch in #14, but this patch did not solve my problem completely. Know the »user« site seems to work but not the other sites like »user/register« etc.
I do not get any further reports (on admin/reports/dblog). Don't know how to debug. What could I do?
post scriptum: Know I figured out, that the issue's cause are these lines in one of my custom modules:
The link creation is wrong, must be:
I'am sorry to bother you, was my fault!