From fae48e9ee48237c05379295e6d7496baf471610e Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Thu, 5 Sep 2013 08:35:47 +0200 Subject: [PATCH] fix issue in Lang Model --- core/lib/Thelia/Model/Lang.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/core/lib/Thelia/Model/Lang.php b/core/lib/Thelia/Model/Lang.php index d6b1a204c..3c45ade33 100755 --- a/core/lib/Thelia/Model/Lang.php +++ b/core/lib/Thelia/Model/Lang.php @@ -9,17 +9,14 @@ class Lang extends BaseLang { /** * Return the default language object, using a local variable to cache it. * - * @throws RuntimeException + * @throws \RuntimeException */ - private static $default_lang = null; - public static function getDefaultLanguage() { - if (self::$default_lang == null) { - $default_lang = LangQuery::create()->findOneByByDefault(true); - if ($default_lang == null) throw new RuntimeException("No default language is defined. Please define one."); - } + $default_lang = LangQuery::create()->findOneByByDefault(1); + + if ($default_lang == null) throw new \RuntimeException("No default language is defined. Please define one."); return $default_lang; }