From 846510ef93ce799c1330ac56d9b22f3b39425d63 Mon Sep 17 00:00:00 2001 From: Maxim Leshchenko Date: Thu, 16 Dec 2021 21:23:28 +0200 Subject: [PATCH] Fixup "Groups: Transfer community permissions to another user (#348)" Didn't notice these problems during the code review :3 --- Web/Presenters/GroupPresenter.php | 13 ++++++++++++- Web/Presenters/templates/Group/Followers.xml | 15 ++++++++------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/Web/Presenters/GroupPresenter.php b/Web/Presenters/GroupPresenter.php index 376749a5..1af8ef28 100644 --- a/Web/Presenters/GroupPresenter.php +++ b/Web/Presenters/GroupPresenter.php @@ -291,7 +291,18 @@ final class GroupPresenter extends OpenVKPresenter $this->flashFail("err", tr("error"), tr("forbidden")); $club->setOwner($newOwnerId); - $club->addManager($this->user->id); + + $club->addManager($this->user->identity); + $oldOwnerManager = $club->getManager($this->user->identity); + $oldOwnerManager->setHidden($club->isOwnerHidden()); + $oldOwnerManager->setComment($club->getOwnerComment()); + $oldOwnerManager->save(); + + $newOwnerManager = $club->getManager($newOwner); + $club->setOwner_Hidden($newOwnerManager->isHidden()); + $club->setOwner_Comment($newOwnerManager->getComment()); + $club->removeManager($newOwner); + $club->save(); $this->flashFail("succ", tr("information_-1"), tr("group_owner_setted", $newOwner->getCanonicalName(), $club->getName())); diff --git a/Web/Presenters/templates/Group/Followers.xml b/Web/Presenters/templates/Group/Followers.xml index 6556198b..e6409ac4 100644 --- a/Web/Presenters/templates/Group/Followers.xml +++ b/Web/Presenters/templates/Group/Followers.xml @@ -123,21 +123,22 @@ -