Wall: Hotfix when group's wall link was without minus in url

This commit is contained in:
veselcraft 2021-09-17 20:46:32 +03:00
parent 4b1282c51a
commit 9578759f17
2 changed files with 9 additions and 3 deletions

View file

@ -250,8 +250,14 @@ final class WallPresenter extends OpenVKPresenter
$this->logPostView($post, $wall);
$this->template->post = $post;
if ($post->getTargetWall() > 0) $this->template->wallOwner = (new Users)->get($post->getTargetWall());
else $this->template->wallOwner = (new Clubs)->get($post->getTargetWall());
if ($post->getTargetWall() > 0)
{
$this->template->wallOwner = (new Users)->get($post->getTargetWall());
$this->template->isWallOfGroup = false;
} else {
$this->template->wallOwner = (new Clubs)->get(abs($post->getTargetWall()));
$this->template->isWallOfGroup = true;
}
$this->template->cCount = $post->getCommentsCount();
$this->template->cPage = (int) ($_GET["p"] ?? 1);
$this->template->comments = iterator_to_array($post->getComments($this->template->cPage));

View file

@ -6,7 +6,7 @@
{$wallOwner->getCanonicalName()}
</a>
»
<a href="/wall{$wallOwner->getId()}">
<a href="/wall{$wallOwner->getId() * ($isWallOfGroup ? -1 : 1)}">
{_wall}
</a>
»