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

mrharolda’s picture

damien tournoud’s picture

Hum, the problem is elsewhere.

The logic behind all translation functions (t(), format_plural(), etc.) is that $language->language should be set. That way, if there are called with a NULL $langcode, they use the default language of the site.

$language is supposed to be set by drupal_init_language() in early bootstrap phases.

plach’s picture

Component: language system » locale.module

Cleaning-up the "language system" issue queue as per http://cyrve.com/criticals.

fietserwin’s picture

Status: Active » Closed (fixed)

Somewhere, sometime, this has already been fixed. The current code properly initializes $langcode if it is null using the global $language.