Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
locale.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 May 2008 at 13:44 UTC
Updated:
17 Jul 2011 at 11:33 UTC
The default value of $langcode (NULL) is used as array index in line 422 of locale.module which raises 2 E_NOTICE's...
Function call:
function locale_get_plural($count, $langcode = NULL) {
Line 422:
$locale_formula[$langcode] = $language_list[$langcode]->formula;
I'm not familiar enough with the locale system to provide a patch...
Comments
Comment #1
mrharolda commentedComplete source code: http://api.drupal.org/api/function/locale_get_plural/7
Comment #2
damien tournoud commentedHum, the problem is elsewhere.
The logic behind all translation functions (
t(),format_plural(), etc.) is that$language->languageshould be set. That way, if there are called with a NULL$langcode, they use the default language of the site.$languageis supposed to be set bydrupal_init_language()in early bootstrap phases.Comment #3
plachCleaning-up the "language system" issue queue as per http://cyrve.com/criticals.
Comment #4
fietserwinSomewhere, sometime, this has already been fixed. The current code properly initializes $langcode if it is null using the global $language.