When I have normal caching enabled, the following error is presented to anonymous users:

Fatal error: Call to undefined function: t() in /home/mantraso/public_html/sites/all/modules/singlesignon/singlesignon.module on line 126

Authenticated users do not receive this error. With caching disabled, the site works fine for anonymous users again.

I did a search and returned this result (if it's helpful at all - this is for the advuser module) - http://drupal.org/node/76073

Comments

allen’s picture

I can not use caching with ethier of the following:
singlesignon.module, persistent_login.module or multidomain.module

Error:

Notice: Undefined index: persistent_login_check in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\allensworld\modules\addmodules\persistent_login\persistent_login.module on line 260

Notice: Undefined index: HTTPS in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\allensworld\modules\addmodules\multidomain\multidomain.module on line 277

Notice: Undefined index: http://www.allensworld.org in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\allensworld\modules\addmodules\multidomain\multidomain.module on line 278

Notice: Undefined index: HTTPS in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\allensworld\modules\addmodules\multidomain\multidomain.module on line 301

Fatal error: Call to undefined function t() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\allensworld\modules\addmodules\singlesignon\singlesignon.module on line 119

Notice: Undefined property: stdClass::$cache in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\allensworld\includes\session.inc on line 77

Can some one please help me

danielc’s picture

Title: Fatal error for anonymous users when caching is enabled (Drupal 5) » Call to undefined function t() (when caching enabled)
Version: master » 5.x-1.x-dev

http://drupal.org/node/118458 marked duplicate of this.

danielc’s picture

Title: Call to undefined function t() (when caching enabled) » Call to undefined function t()
particle’s picture

This bug is severe enough to take down multiple sites at once and it is easily reproduced.

jonmiles’s picture

The file in question is singlesignon.modules, and should be wherever you put your modules.
Go to the line mentioned in the error, mine was line 127, and remove the stray "t".

line looked like:
if ($op == t('Log in')) {

should be:
if ($op == ('Log in')) {

At least, this is what I gather, as this fixed the problem.

yngens’s picture

jonmiles, thank you.

shouldn't it be like

if ($op == 'Log in') {

if we take 't' out then we should also get rid of its parentheses.

frjo’s picture

This is a translatable string so for it to work on non english sites it needs the t(). I provided the patch for this myself, see http://drupal.org/node/102447.

I later found that this made the module not work with cache turned on. Another developer then found that including common.inc in singlesignon_init() somewhere above "t('Log in')" solves the problem.

include_once('includes/common.inc');

We run this on a installation with 25000+ users to get singel sign-on between two sites and it works well.

wayland76’s picture

Status: Active » Closed (duplicate)
beijinger’s picture

wrong post. sorry.