From 9d862819cf8f1d9f14a4f5465ca84579b05fb959 Mon Sep 17 00:00:00 2001 From: marcus Date: Wed, 22 Apr 2009 15:49:24 +0000 Subject: Deleting correct data + using correct tables git-svn-id: https://code.elgg.org/elgg/trunk@3228 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/annotations.php | 4 +++- engine/lib/metadata.php | 4 +++- engine/lib/users.php | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php index dd647444a..47903616a 100644 --- a/engine/lib/annotations.php +++ b/engine/lib/annotations.php @@ -829,6 +829,8 @@ */ function clear_annotations_by_owner($owner_guid) { + global $CONFIG; + $owner_guid = (int)$owner_guid; $annotations = get_data("SELECT id from {$CONFIG->dbprefix}annotations WHERE owner_guid=$owner_guid"); @@ -836,7 +838,7 @@ foreach ($annotations as $id) { - if (delete_annotation($id)) // Is this the best way? + if (delete_annotation($id->id)) // Is this the best way? $deleted++; } diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php index 57987107c..ca127c386 100644 --- a/engine/lib/metadata.php +++ b/engine/lib/metadata.php @@ -739,6 +739,8 @@ */ function clear_metadata_by_owner($owner_guid) { + global $CONFIG; + $owner_guid = (int)$owner_guid; $metas = get_data("SELECT id from {$CONFIG->dbprefix}metadata WHERE owner_guid=$owner_guid"); @@ -746,7 +748,7 @@ foreach ($metas as $id) { - if (delete_metadata($id)) // Is this the best way? + if (delete_metadata($id->id)) // Is this the best way? $deleted++; } diff --git a/engine/lib/users.php b/engine/lib/users.php index 5a9234dc6..cddc89b3a 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -153,8 +153,8 @@ public function delete() { // Delete owned data - clear_annotations_by_owner($this->owner_guid); - clear_metadata_by_owner($this->owner_guid); + clear_annotations_by_owner($this->guid); + clear_metadata_by_owner($this->guid); // Delete entity return parent::delete(); -- cgit v1.2.3