} elseif ($this->selectedTab == ChannelEntity::AUDIO) {
$condition = ["`media-type` & ?", 4];
} elseif ($this->selectedTab == ChannelEntity::LANGUAGE) {
- $condition = ["JSON_EXTRACT(JSON_KEYS(language), '$[0]') = ?", $this->l10n->convertCodeForLanguageDetection(User::getLanguageCode($uid))];
+ $condition = ["JSON_EXTRACT(JSON_KEYS(language), '$[0]') = ?", User::getLanguageCode($uid)];
} elseif (is_numeric($this->selectedTab)) {
$condition = $this->getUserChannelConditions($this->selectedTab, $this->session->getLocalUserId());
}
$items = [];
$result = $this->database->select('post-engagement', ['uri-id', 'created', 'owner-id', 'comments', 'activities'], $condition, $params);
+ if ($this->database->errorNo()) {
+ throw new \Exception($this->database->errorMessage(), $this->database->errorNo());
+ }
+
while ($item = $this->database->fetch($result)) {
$items[$item['uri-id']] = $item;
}
{
$conditions = [];
$languages = $this->pConfig->get($uid, 'channel', 'languages', [User::getLanguageCode($uid)]);
- $languages = $this->l10n->convertForLanguageDetection($languages);
foreach ($languages as $language) {
$conditions[] = "JSON_EXTRACT(JSON_KEYS(language), '$[0]') = ?";
$condition[] = $language;