1
0
mirror of https://github.com/flarum/core.git synced 2025-08-01 06:00:24 +02:00

Only get posts with registered types.

This is so that if an extension adds a post type, and the database gets
populated with posts of that type, but then if the extension is
disabled, we wouldn’t want those posts to display because we would have
no knowledge about how to deal with/render them.
This commit is contained in:
Toby Zerner
2015-03-28 12:13:19 +10:30
parent 38ebb15334
commit afa4b98c4a
3 changed files with 75 additions and 1 deletions

View File

@@ -68,7 +68,7 @@ class Discussion extends Model
static::deleted(function ($discussion) {
$discussion->raise(new DiscussionWasDeleted($discussion));
$discussion->posts()->delete();
$discussion->posts()->allTypes()->delete();
$discussion->readers()->detach();
});
}