I'm testing the new lmpaypal, donations, subscription, and classified modules.

I kept getting errors like undefined function for t().

lm said t is loaded with common.inc and probably my site is messed up. to try a completely new install. i can't think of any way this can happen

I have a brand new 4.7.3 install with no contrib except the 4 lmpaypal, donations, subscription, and classified modules. i get an entire page of this error

how can this function be undefined if it's loaded with common.inc?
[Mon Aug 21 14:08:19 2006] [error] PHP Fatal error: Call to undefined function: l() in /home/ /public_html /modules/lm_paypal/lm_paypal.module on line 61
[Mon Aug 21 14:05:15 2006] [error] PHP Fatal error: Call to undefined function: l() in /home/ /public_html /modules/lm_paypal/lm_paypal.module on line 61
[Mon Aug 21 14:05:15 2006] [error] PHP Fatal error: Call to undefined function: l() in /home/ /public_html /modules/lm_paypal/lm_paypal.module on line 61
[Mon Aug 21 14:05:15 2006] [error] PHP Fatal error: Call to undefined function: l() in /home/ /public_html /modules/lm_paypal/lm_paypal.module on line 61
[Mon Aug 21 14:05:13 2006] [error] PHP Fatal error: Call to undefined function: l() in /home/ /public_html /modules/lm_paypal/lm_paypal.module on line 61
[Mon Aug 21 14:05:11 2006] [error] PHP Fatal error: Call to undefined function: l() in /home/ /public_html /modules/lm_paypal/lm_paypal.module on line 61
[Mon Aug 21 14:03:40 2006] [error] PHP Fatal error: Call to undefined function: l() in /home/ /public_html /modules/lm_paypal/lm_paypal.module on line 61
[Mon Aug 21 14:03:40 2006] [error] PHP Fatal error: Call to undefined function: l() in /home/ /public_html /modules/lm_paypal/lm_paypal.module on line 61
[Mon Aug 21 14:00:20 2006] [error] PHP Fatal error: Call to undefined function: l() in /home/ /public_html /modules/lm_paypal/lm_paypal.module on line 61
[Mon

the site seems to work correctly. I would not even have noticed it except i looked in the cpanel error logs.
http://drupal.org/node/78002#comment-147105

Comments

styro’s picture

Did it happen before you installed those modules? l() and t() are used just about everywhere, so the problem would've shown up earlier I imagine.

PS: /home/ /public_html /modules/lm_paypal/lm_paypal.module seems a strange path (with the space in it). But I don't know if that is related.

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ
Example Knowledge Base built using Drupal

mwu’s picture

styro,
thank you.

no, the problem did not show up before I installed the lm modules. I agree, those are used everywhere so it's odd for l to be not found.

you are right about the path names. the path names have been modified to remove the names of my site.

any other thoughts you have would be appreciated.

styro’s picture

Submit a bug report for the module in question, so that if the developer(s) can reproduce the problem they can then fix it. I'm a little baffled about how it could actually happen though.

There may be plenty of questions from the developer about your environment though before they find they can or can't reproduce it though.

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ
Example Knowledge Base built using Drupal

karens’s picture

When you submit the bug report, suggest the developer look at hook_init(). The functions are not loaded until after hook_init() runs and I have seen this error on other modules that tried to use various drupal functions in hook_init(). Also, hook_init() runs even for cached pages, and in those cases the functions are not loaded at all.

You pretty much have to assume that no functions are available in that hook, so hook_init() either needs to be rewritten not to use functions or the functions must be moved to some other place that runs later in the startup process.

mwu’s picture

KarenS,
thank you. the problem does seem to be hook init

http://drupal.org/node/78002#comment-147355

Here is the answer I got from a Drupal developer:

[begin quote]
In line with what KarenS wrote: lm_paypal does some things in hook_init it
shouldn't do (and can't do):
for example:

$link = l('LMMR Tech', 'http://lmmrtech.com');
$_lm_paypal_welcome = '<p>'. t('Welcome to the %lm PayPal modules for 
Drupal.', array('%lm' => $link)) .'</p>';
$_lm_paypal_welcome .= '<p><b>'. t('These modules are still undergoing 
development so it is strongly advised that you to test them out against 
the PayPal Sandbox first.') .'</b></p>';

Drupal has multiple so called bootstrap phases; depending on the stage and
cache settings, not all functions are loaded.
[end quote]