Error when deleting an episode with an existing post

Describe the bug

When deleting an episode that is referenced in a post, the activity page crashes.

Steps to reproduce

  1. Create an episode
  2. Publish the episode now (a post linked to the episode is created with it)
  3. Go to the activity page, the related post is shown, the episode is published
  4. Delete the episode
  5. Go to the podcast homepage, an error is shown, the page crashed

Expected behavior

The post should be deleted with the episode?

Actual behavior

The post is not deleted with the episode resulting in the page crash.

Relevant logs and/or screenshots

log-2021-05-07.log

image

Context

  • Castopod alpha 42
  • OS: Mac OS 10.13.6
  • Browser: firefox 87.0
  • Web server: OVH mutu / sql 5.2

Possible fixes

Delete the note when deleting the episode? Remove the episode_id on the post when deleting the episode?

Edited Jul 30, 2021 by Yassine Doghri
Assignee Loading
Time tracking Loading