Closed (fixed)
Project:
Drupal core
Version:
8.9.x-dev
Component:
locale.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
19 Mar 2009 at 14:52 UTC
Updated:
23 Oct 2020 at 13:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
damien tournoud commentedHopefully, it is easy enough to fix.
Comment #3
damien tournoud commentedWrong order in my patch stack.
Comment #5
damien tournoud commentedDear Damien, please be more careful with your merges.
Comment #7
damien tournoud commented:(
Comment #8
moshe weitzman commentedHarmless for sure. And if you say it helps testing, then in it goes.
Comment #9
sunThe reason for using function_exists() is that the localization system is pluggable. Locale module is just one of many possible implementations.
This patch at the very least needs Gábor's approval.
Comment #10
damien tournoud commentedThis way of making pluggable things is deprecated and incompatible with the registry. Even if there is no replacement for now (waiting for something like the handler patch), I believe we can already get rid of that, especially because I believe no contrib module actually uses this "feature".
Comment #11
moshe weitzman commentedagreed.
Comment #12
sunI'd say it should be drupal_function_exists() instead.
Comment #13
damien tournoud commentedNo. Using
module_exists()here is designed to make the whole stuff more robust to the testing framework, in which a function can be loaded (because locale.module was loaded at one point) without the module being actually enabled.Comment #14
webchickHm. This patch makes http://drupal.org/project/stringoverrides module impossible, and represents a regression in functionality.
I would prefer to fix this in SimpleTest module than remove this. What exactly is the issue?
Comment #15
damien tournoud commentedstringoverrides is nothing more then an interface around locale_custom_strings_* and locale_disabled_strings_*. It doesn't use the broken feature that is removed here. As I stated in #10, I know no contribution module that uses that.
Comment #16
dries commentedPer #9, I've asked Gabor to comment on this issue, and will pull the trigger if he gives me a 'yay'.
Comment #17
gábor hojtsyThe reason we had function_exists() there was that we did not necessarily tie this to locale module but to any module implementing the locale() function. This patch basically removes that flexibility. I don't know of any module which would use this feature however, so it could be safe to do. Otherwise, it would be good to document why are we doing a module_exists(). We usually use drupal_function_exists() as sun pointed out, and others will point this out and/or try to "fix" this if this is not documented right. We should say that this is dependent on the module being turned on and the locale() function is used from there.
Comment #18
dries commentedLet's document it better in the code, and then commit it to CVS HEAD. Thanks!
Comment #19
damien tournoud commentedHere is the expected reroll, with the documentation fix.
Comment #20
moshe weitzman commenteddocs are in.
Comment #21
dries commentedCommitted to CVS HEAD. Thanks.
Comment #23
catchWe just reverted this in #523694: Speed up t() five times when xdebug profiling is enabled., re-opening this one since the simpletest issue will remain.
This fix made t() quite a bit slower - we replaced a single function_exists() with module_exists(), module_list(), and array_key_exists() which has a measurable performance impact in HEAD.
edit: also it looks like someone reverted the extra documentation in the interim - wasn't there when I was patching last night, so only found this issue when chx hinted at it after commit.
Comment #24
plachCleaning-up the "language system" issue queue as per http://cyrve.com/criticals.
Comment #25
marvil07 commentedI am wondering if the patch at #523694-14: Speed up t() five times when xdebug profiling is enabled. actually solves the original issue(parent site with locale enabled) here.
Original comment there mentions:
but I guess that's about the other issue, but it could solve this one, am I right?
PS: moving to 8.x since AFAIK the change needs to be done there first.
Comment #26
jhedstromThe
t()function and the underlying subsystem has evolved much in the past 4 years. Is there anything left to be done here?Comment #40
pameeela commented@Damien Tournoud @jhedstrom I don't know enough about multilingual to say, but it seems likely this can be closed, given the comment at #26 and lack of follow up?
Comment #41
pameeela commentedComment #42
pameeela commentedClosing since no update, feel free to set back to active if this is a mistake.
Comment #43
marvil07 commented@pameeela Thanks for taking care of this old bug!
The change was actually added to D8, but later code changed, so I am moving it to fixed, just for archival reasons.