Fixed dangling postscore and crossref rows
This commit is contained in:
parent
7605177a6b
commit
0286e11c30
2 changed files with 3 additions and 0 deletions
|
@ -552,6 +552,8 @@ class PostController
|
|||
if (InputHelper::get('submit'))
|
||||
{
|
||||
//remove stuff from auxiliary tables
|
||||
R::trashAll(R::find('postscore', 'post_id = ?', [$post->id]));
|
||||
R::trashAll(R::find('crossref', 'post_id = ? OR post2_id = ?', [$post->id, $post->id]));
|
||||
foreach ($post->ownComment as $comment)
|
||||
{
|
||||
$comment->post = null;
|
||||
|
|
|
@ -253,6 +253,7 @@ class UserController
|
|||
if ($suppliedPasswordHash != $user->pass_hash)
|
||||
throw new SimpleException('Must supply valid password');
|
||||
}
|
||||
R::trashAll(R::find('postscore', 'user_id = ?', [$user->id]));
|
||||
foreach ($user->alias('commenter')->ownComment as $comment)
|
||||
{
|
||||
$comment->commenter = null;
|
||||
|
|
Loading…
Reference in a new issue