From 6afc5ccf5c5d70b3aef4024f892141a07779c25f Mon Sep 17 00:00:00 2001 From: Andy Staudacher Date: Tue, 23 Feb 2010 10:02:27 -0800 Subject: Fix translation cache for installations with 0 translations in the DB. --- modules/gallery/libraries/Gallery_I18n.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gallery/libraries/Gallery_I18n.php b/modules/gallery/libraries/Gallery_I18n.php index 0e9c0bdc..f1e77744 100644 --- a/modules/gallery/libraries/Gallery_I18n.php +++ b/modules/gallery/libraries/Gallery_I18n.php @@ -166,7 +166,8 @@ class Gallery_I18n_Core { $cache_key = "translation|" . $locale; $cache = Cache::instance(); $translations = $cache->get($cache_key); - if (empty($translations)) { + if (!isset($translations) || !is_array($translations)) { + $translations = array(); foreach (db::build() ->select("key", "translation") ->from("incoming_translations") -- cgit v1.2.3