Don't use t() inside define()

dereine - April 29, 2009 - 07:12
Project:Buy Me a Beer
Version:6.x-1.0
Component:Code
Category:task
Priority:critical
Assigned:yaph
Status:closed
Description

You should never never use define together with the t function:

see http://drupal.org/node/317001

this is a performance disaster, the language cache is rebuild every time, so here is a patch

thx :)

perhaps the t function should be left of variable_get

AttachmentSize
buymeabeer-not-definie-t.patch1.56 KB

#1

yaph - April 29, 2009 - 09:37

Thanks for the patch. I removed the calls to t() within define calls and moved it to variable_get. Is there any evidence that t() should not be used in variable_get as well?

#2

yaph - April 29, 2009 - 09:38
Assigned to:Anonymous» yaph
Status:active» fixed

#3

kiamlaluno - April 29, 2009 - 09:57
Title:define( with t» Don't use t() inside define()
Category:feature request» task

#4

yaph - April 29, 2009 - 10:04

Fixed in release buymeabeer 6.x-1.1-beta3 http://drupal.org/node/448228

#5

System Message - May 13, 2009 - 10:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.