From a65809c5bd7312108d8db20a250b3ce8ebb3c0d7 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 3 Jul 2012 17:12:59 -0400 Subject: [PATCH] Fix language code for users --- lib/jsonsearchresultslist.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/jsonsearchresultslist.php b/lib/jsonsearchresultslist.php index 8bf3678d4f..c9b2705991 100644 --- a/lib/jsonsearchresultslist.php +++ b/lib/jsonsearchresultslist.php @@ -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); -- 2.39.5