From be54ce2c22356da4e038a45904606c5e9d4963a3 Mon Sep 17 00:00:00 2001 From: flashwave Date: Thu, 8 Feb 2024 00:06:23 +0000 Subject: [PATCH] Fixed oversights on landing page. --- src/Home/HomeRoutes.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Home/HomeRoutes.php b/src/Home/HomeRoutes.php index b861ca5..4433626 100644 --- a/src/Home/HomeRoutes.php +++ b/src/Home/HomeRoutes.php @@ -53,14 +53,14 @@ class HomeRoutes extends RouteHandler { private array $newsCategoryInfos = []; - private function getFeaturedNewsPosts(int $amount, bool $decorate): array { + private function getFeaturedNewsPosts(int $amount, bool $decorate): iterable { $postInfos = $this->news->getPosts( onlyFeatured: true, pagination: new Pagination($amount) ); if(!$decorate) - return $postInfos; + return iterator_to_array($postInfos); $posts = []; @@ -221,7 +221,7 @@ class HomeRoutes extends RouteHandler { } else $linkedData = null; $stats = $this->getStats(); - $onlineUserInfos = $this->getOnlineUsers(); + $onlineUserInfos = iterator_to_array($this->getOnlineUsers()); $featuredNews = $this->getFeaturedNewsPosts(3, false); $popularTopics = $this->getPopularForumTopics($config['landing.forum_categories']); $activeTopics = $this->getActiveForumTopics($config['landing.forum_categories']);