From b93244395f2c5643ae5e1be1e4e1d652c6d654c1 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 6 Jan 2010 11:10:33 -0800 Subject: Fix for broken profile flag admin UI: delete stray flag entries when users are deleted so broken entries don't litter the lookups. * added ProfileDeleteRelated event to match UserDeleteRelated, to allow plugins to add extra related tables on profile deletion * UserFlagPlugin: deleting flags when target profile is deleted * UserFlagPlugin: deleting flags when flagging user is deleted * UserFlagPlugin: fix for autoloader -- class names are case-insensitive. We may get lowercase class names coming in at times, such as when creating DB objects programatically from a table name. Note that any already-existing bogus entries need to be removed from the database: select * from user_flag_profile where (select id from profile where id=profile_id) is null; select * from user_flag_profile where (select id from user where id=user_id) is null; --- classes/Profile.php | 1 + 1 file changed, 1 insertion(+) (limited to 'classes') diff --git a/classes/Profile.php b/classes/Profile.php index 03196447b..25d908dbf 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -504,6 +504,7 @@ class Profile extends Memcached_DataObject 'Reply', 'Group_member', ); + Event::handle('ProfileDeleteRelated', array($this, &$related)); foreach ($related as $cls) { $inst = new $cls(); -- cgit v1.2.3-54-g00ecf