From 51276d66cca40e3c9019ab72c39a0c76c897c446 Mon Sep 17 00:00:00 2001 From: mrilyew <99399973+mrilyew@users.noreply.github.com> Date: Tue, 12 Nov 2024 15:05:21 +0300 Subject: [PATCH] dont remove repost when editin' --- VKAPI/Handlers/Wall.php | 7 ++++++- .../templates/components/post/microblogpost.xml | 2 +- Web/Presenters/templates/components/post/oldpost.xml | 2 +- Web/static/js/al_wall.js | 8 ++++++++ locales/en.strings | 1 + locales/ru.strings | 1 + 6 files changed, 18 insertions(+), 3 deletions(-) diff --git a/VKAPI/Handlers/Wall.php b/VKAPI/Handlers/Wall.php index dad7f883..400e15da 100644 --- a/VKAPI/Handlers/Wall.php +++ b/VKAPI/Handlers/Wall.php @@ -1003,7 +1003,12 @@ final class Wall extends VKAPIRequestHandler $post->save(true); if($attachments == 'remove' || sizeof($final_attachments) > 0) { - $post->unwire(); + foreach($post->getChildren() as $att) { + if(!($att instanceof Post)) { + $post->detach($att); + } + } + foreach($final_attachments as $attachment) { $post->attach($attachment); } diff --git a/Web/Presenters/templates/components/post/microblogpost.xml b/Web/Presenters/templates/components/post/microblogpost.xml index 6377516e..9635f417 100644 --- a/Web/Presenters/templates/components/post/microblogpost.xml +++ b/Web/Presenters/templates/components/post/microblogpost.xml @@ -109,7 +109,7 @@ -
+ - +