X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FConversation%2FTimeline.php;h=725634eb0920ffd68e5ab27ba6962aa8979af1ca;hb=3f2b0b9422915529a0ea585aa4325b6d2f2f65cd;hp=8ddba16c71961ae88fc069613b4ec9c561aaad3b;hpb=8ac6d0ef046eff3d12e3e7870aa404e0470c18f5;p=friendica.git diff --git a/src/Module/Conversation/Timeline.php b/src/Module/Conversation/Timeline.php index 8ddba16c71..725634eb09 100644 --- a/src/Module/Conversation/Timeline.php +++ b/src/Module/Conversation/Timeline.php @@ -26,7 +26,7 @@ use Friendica\App\Mode; use Friendica\BaseModule; use Friendica\Content\Conversation\Collection\Timelines; use Friendica\Content\Conversation\Entity\Channel as ChannelEntity; -use Friendica\Content\Conversation\Repository\Channel; +use Friendica\Content\Conversation\Repository\UserDefinedChannel; use Friendica\Core\Cache\Capability\ICanCache; use Friendica\Core\Cache\Enum\Duration; use Friendica\Core\Config\Capability\IManageConfigValues; @@ -80,10 +80,10 @@ class Timeline extends BaseModule protected $config; /** @var ICanCache */ protected $cache; - /** @var Channel */ + /** @var UserDefinedChannel */ protected $channelRepository; - public function __construct(Channel $channel, Mode $mode, IHandleUserSessions $session, Database $database, IManagePersonalConfigValues $pConfig, IManageConfigValues $config, ICanCache $cache, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) + public function __construct(UserDefinedChannel $channel, Mode $mode, IHandleUserSessions $session, Database $database, IManagePersonalConfigValues $pConfig, IManageConfigValues $config, ICanCache $cache, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) { parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); @@ -304,7 +304,7 @@ class Timeline extends BaseModule } 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()); } @@ -346,6 +346,10 @@ class Timeline extends BaseModule $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; } @@ -417,7 +421,6 @@ class Timeline extends BaseModule { $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;