]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fix language code for users
authorEvan Prodromou <evan@status.net>
Tue, 3 Jul 2012 21:12:59 +0000 (17:12 -0400)
committerEvan Prodromou <evan@status.net>
Tue, 3 Jul 2012 21:12:59 +0000 (17:12 -0400)
lib/jsonsearchresultslist.php

index 8bf3678d4fa12fc5fad55d875b55c8985b3e2fe4..c9b2705991f91e262f9ce53690f97e45c28d6754 100644 (file)
@@ -232,10 +232,15 @@ class ResultItem
         $this->id           = $this->notice->id;
         $this->from_user_id = $this->profile->id;
 
-        $user = User::staticGet('id', $this->profile->id);
-
-        $this->iso_language_code = $user->language;
+        $user = $this->profile->getUser();
 
+        if (empty($user)) {
+            // Gonna have to do till we can detect it
+            $this->iso_language_code = common_config('site', 'language');
+        } else {
+            $this->iso_language_code = $user->language;
+        }
+        
         $this->source = $this->getSourceLink($this->notice->source);
 
         $avatar = $this->profile->getAvatar(AVATAR_STREAM_SIZE);