The Line
define("AUTOASSIGNROLE_ROLE_USER_TITLE", t("Role"));
causes the translation System to call the t() function before a locale is initialized.
this can be fixed in different ways:
1) directly in the locale.module
function locale($string) {
global $locale;
static $locale_t;
+ if (empty($locale)){
+ $locale = locale_initialize();
+ }
// Store database cached translations in a static var.
2) the autoassign.module (Method 1)
-define("AUTOASSIGNROLE_ROLE_USER_TITLE", t("Role"));
+define("AUTOASSIGNROLE_ROLE_USER_TITLE", "Role");
3) the autoassign.module (Method 2)
-define("AUTOASSIGNROLE_ROLE_USER_TITLE", t("Role"));
Replace every "AUTOASSIGNROLE_ROLE_USER_TITLE" by t("Role")
I would prefer the third Method. But placing the code from 1) can be a nice fix for every other buggy Module call.
Fixing this bug causes the page building being 50-80ms faster. The whole client-page-building process seems significant faster.
Best Regards
Passer
Comments
Comment #1
cyberswat commentedAny chance of you rolling a patch for option 3?
Comment #2
Passer commentedI guess opening the file and copy+replacing it all like described would fit more users, because not everyone knows how to apply a .patch file
Best Regards
Passer
Comment #3
cyberswat commentedThe request for a patch was so that I could apply it to the dev branch and commit it
Comment #4
cyberswat commentedhttp://drupal.org/cvs?commit=222690