From: Evan Prodromou Date: Tue, 3 Jul 2012 21:12:59 +0000 (-0400) Subject: Fix language code for users X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a65809c5bd7312108d8db20a250b3ce8ebb3c0d7;p=quix0rs-gnu-social.git Fix language code for users --- 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);