From 029ce27e419c6badb80b30ac497765915e5dad37 Mon Sep 17 00:00:00 2001 From: lalka2018 <99399973+lalka2016@users.noreply.github.com> Date: Wed, 15 Nov 2023 22:41:18 +0300 Subject: [PATCH] PHP 8 FIX WATAFAK --- ServiceAPI/Wall.php | 2 +- Web/Presenters/GroupPresenter.php | 4 ++-- .../sqls/{00039-suggest-posts.sql => 00043-suggest-posts.sql} | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename install/sqls/{00039-suggest-posts.sql => 00043-suggest-posts.sql} (100%) diff --git a/ServiceAPI/Wall.php b/ServiceAPI/Wall.php index f8d9fca2..06d7353c 100644 --- a/ServiceAPI/Wall.php +++ b/ServiceAPI/Wall.php @@ -132,7 +132,7 @@ class Wall implements Handler ]; foreach($videos as $video) { - $res = json_decode(json_encode($video->toVkApiStruct()), true); + $res = json_decode(json_encode($video->toVkApiStruct($this->user)), true); $res["video"]["author_name"] = $video->getOwner()->getCanonicalName(); $arr["items"][] = $res; diff --git a/Web/Presenters/GroupPresenter.php b/Web/Presenters/GroupPresenter.php index 6c89ea25..beeede13 100644 --- a/Web/Presenters/GroupPresenter.php +++ b/Web/Presenters/GroupPresenter.php @@ -448,11 +448,11 @@ final class GroupPresenter extends OpenVKPresenter } if(!$club->canBeModifiedBy($this->user->identity)) { - $this->template->posts = (new Posts)->getSuggestedPostsByUser($club->getId(), $this->user->id, (int) ($this->queryParam("p") ?? 1)); + $this->template->posts = iterator_to_array((new Posts)->getSuggestedPostsByUser($club->getId(), $this->user->id, (int) ($this->queryParam("p") ?? 1))); $this->template->count = (new Posts)->getSuggestedPostsCountByUser($club->getId(), $this->user->id); $this->template->type = "my"; } else { - $this->template->posts = (new Posts)->getSuggestedPosts($club->getId(), (int) ($this->queryParam("p") ?? 1)); + $this->template->posts = iterator_to_array((new Posts)->getSuggestedPosts($club->getId(), (int) ($this->queryParam("p") ?? 1))); $this->template->count = (new Posts)->getSuggestedPostsCount($club->getId()); $this->template->type = "everyone"; } diff --git a/install/sqls/00039-suggest-posts.sql b/install/sqls/00043-suggest-posts.sql similarity index 100% rename from install/sqls/00039-suggest-posts.sql rename to install/sqls/00043-suggest-posts.sql