Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
locale.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
3 Jun 2009 at 03:26 UTC
Updated:
9 Jul 2016 at 00:16 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
JamesAn commentedA wrapper function as per #422362-20: convert form.inc to use new static caching API was created to reset the static vars.
Comment #3
JamesAn commentedOops. I missed changes in locale.test. All done.
Comment #5
JamesAn commentedI think I caught the bug this time. The static var, $locale_formula, in locale_get_plural() needed to be initialized to an array and the check had to be changed from !isset($locale_formula) to empty($locale_formula), as sometimes $locale_formula would be set to an empty array, which passed the isset() check.
Comment #7
JamesAn commentedComment #9
JamesAn commentedI'm getting strange test results.
The fails/exceptions don't correspond to any failed assertions. There's actually no corresponding message or assertion to the fails. I've filed an issue, #483486: Test returns 1 fail and 1 exception, but themes the result as passing (i.e. green), with simpletest in hopes that people more adept in simpletest can figure out what's going on.
I suppose this issue is postponed on account of that one.
Comment #10
damien tournoud commentedReopening. The bug is in locale_get_plural(), in which two static are sharing the same key:
Comment #11
JamesAn commentedOy vey.. thanks for catching that. I was breaking my head over this problem and didn't see it. ^^"
Done. testbot?
Comment #13
JamesAn commentedRerolled against #334283: Add msgctxt-type context to t(), which adds a context parameter to locale().
Comment #15
JamesAn commentedRerolled.
Comment #17
cburschkaThis also looks good. I was wondering whether we need a "locale_reset()" one-line function for the only two times it is called, but from looking at the API that seems to be the proper pattern...
Comment #19
cburschkaIt seems this patch is still passing.
Comment #20
webchickThanks! Committed to HEAD.
Comment #21
andypostSuppose this change is not good! locale() is used very often so this change should be tested for performance!
If you wanna use drupal_static() so this should be $drupal_static_fast; http://api.drupal.org/api/function/drupal_static/7
Comment #22
alexanderpas commentedspelling
Comment #23
hgoto commentedI believe, this issue can be closed because #1387766: Use fast drupal static pattern for locale already introduced
$drupal_static_fastpattern intolocale()and fixed the point #21.If you find something wrong, please re-open this.