Fixed dangling postscore and crossref rows

This commit is contained in:
Marcin Kurczewski
2013-11-18 10:26:29 +01:00
parent 7605177a6b
commit 0286e11c30
2 changed files with 3 additions and 0 deletions

View File

@ -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;