mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-11 10:46:43 +02:00
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:
parent
9cc2996261
commit
8acdafd260
5 changed files with 40 additions and 45 deletions
|
|
@ -74,6 +74,10 @@ class PostController extends FediversePostController
|
|||
$this->registerPodcastWebpageHit($this->podcast->id);
|
||||
}
|
||||
|
||||
if ($this->post === null) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
$cacheName = implode(
|
||||
'_',
|
||||
array_filter([
|
||||
|
|
@ -177,7 +181,7 @@ class PostController extends FediversePostController
|
|||
'created_by' => user_id(),
|
||||
]);
|
||||
|
||||
if ($this->post->in_reply_to_id === null && $this->post->episode_id !== null) {
|
||||
if ($this->post->episode_id !== null) {
|
||||
$newPost->episode_id = $this->post->episode_id;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue