fix(episode-unpublish): set consistent posts_counts' increments/decrements for actors and episodes

Some episodes could not be unpublished because of out of range error when removing posts.

fixes #233
This commit is contained in:
Yassine Doghri 2022-07-21 13:53:29 +00:00
commit 8acdafd260
5 changed files with 40 additions and 45 deletions

View file

@ -714,6 +714,8 @@ class EpisodeController extends BaseController
$allPostsLinkedToEpisode = (new PostModel())
->where([
'episode_id' => $this->episode->id,
'in_reply_to_id' => null,
'reblog_of_id' => null,
])
->findAll();
foreach ($allPostsLinkedToEpisode as $post) {