From 3287ecc8d3f908c0fe68dce00db8d1b5766b4d57 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Mon, 9 Mar 2015 15:01:05 +0100 Subject: [PATCH] Delete Faves onProfileDeleteRelated instead of User --- plugins/Favorite/FavoritePlugin.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/Favorite/FavoritePlugin.php b/plugins/Favorite/FavoritePlugin.php index 49ba2b6845..e4e842d8cc 100644 --- a/plugins/Favorite/FavoritePlugin.php +++ b/plugins/Favorite/FavoritePlugin.php @@ -284,13 +284,14 @@ class FavoritePlugin extends ActivityHandlerPlugin $fave->free(); } - public function onUserDeleteRelated(User $user, array &$related) + public function onProfileDeleteRelated(Profile $profile, array &$related) { $fave = new Fave(); - $fave->user_id = $user->id; + $fave->user_id = $profile->id; $fave->delete(); // Will perform a DELETE matching "user_id = {$user->id}" + $fave->free(); - Fave::blowCacheForProfileId($user->id); + Fave::blowCacheForProfileId($profile->id); return true; }