diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-03-11 10:27:48 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-03-11 10:27:48 +0000 |
commit | ef9ceb15f729896bb513f73d4a69d090dd148455 (patch) | |
tree | c7c73f11f16708556d4af7ec5db2fea706a89966 /engine/lib/entities.php | |
parent | 0b96b664fe19a23cc2a93395bcc40446bf8949e7 (diff) | |
download | elgg-ef9ceb15f729896bb513f73d4a69d090dd148455.tar.gz elgg-ef9ceb15f729896bb513f73d4a69d090dd148455.tar.bz2 |
Closes 868: Fixes regression introduced in [3119]. Version number bumped.
git-svn-id: https://code.elgg.org/elgg/trunk@3153 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/entities.php')
-rw-r--r-- | engine/lib/entities.php | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php index 156f552f4..ff4487570 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -723,8 +723,7 @@ */
public function delete()
{
- $res = delete_entity($this->get('guid'));
- return $res;
+ return delete_entity($this->get('guid'));
}
// LOCATABLE INTERFACE /////////////////////////////////////////////////////////////
@@ -1845,7 +1844,23 @@ $entity->clearRelationships();
remove_from_river_by_subject($guid);
remove_from_river_by_object($guid);
- $res = delete_data("DELETE from {$CONFIG->dbprefix}entities where guid={$guid}");
+ $res = delete_data("DELETE from {$CONFIG->dbprefix}entities where guid={$guid}"); + if ($res) + { + $sub_table = ""; + + // Where appropriate delete the sub table + switch ($entity->type) + { + case 'object' : $sub_table = $CONFIG->dbprefix . 'objects_entity'; break; + case 'user' : $sub_table = $CONFIG->dbprefix . 'users_entity'; break; + case 'group' : $sub_table = $CONFIG->dbprefix . 'groups_entity'; break; + case 'site' : $sub_table = $CONFIG->dbprefix . 'sites_entity'; break; + } + + if ($sub_table) + delete_data("DELETE from $sub_table where guid={$guid}"); + }
return $res;
}
|