From a45c874f720c493457f3dc4d35498ed9bc7b16a7 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 21 Apr 2009 13:26:40 +0000 Subject: [PATCH] "added explicit init(false) calls for methods called by setup (they dont call init() as eGW does)" --- phpgwapi/inc/class.translation.inc.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/phpgwapi/inc/class.translation.inc.php b/phpgwapi/inc/class.translation.inc.php index addb57c360..054301e8f5 100644 --- a/phpgwapi/inc/class.translation.inc.php +++ b/phpgwapi/inc/class.translation.inc.php @@ -330,6 +330,8 @@ class translation { if (!is_array(self::$langs) || $force_read) { + if (is_null(self::$db)) self::init(false); + self::$langs = array(); foreach(self::$db->select(self::LANG_TABLE,'DISTINCT lang,lang_name','lang = lang_id',__LINE__,__FILE__, false,'',false,0,','.self::LANGUAGES_TABLE) as $row) @@ -548,10 +550,8 @@ class translation */ static function install_langs($langs,$upgrademethod='dumpold',$only_app=False) { - if (is_null(self::$db)) - { - self::init(false); - } + if (is_null(self::$db)) self::init(false); + @set_time_limit(0); // we might need some time //echo "

translation_sql::install_langs(".print_r($langs,true).",'$upgrademthod','$only_app')

\n"; if (!isset($GLOBALS['egw_info']['server']) && $upgrademethod != 'dumpold') @@ -796,6 +796,8 @@ class translation { echo '
drop_langs(): Working on: ' . $appname; } + if (is_null(self::$db)) self::init(false); + if (self::$db->select(self::LANG_TABLE,'COUNT(*)',array( 'app_name' => $appname ),__LINE__,__FILE__)->fetchColumn())