From f4401fa9ddcc0078928608f4b212a7e1f2a41785 Mon Sep 17 00:00:00 2001 From: rWatcher Date: Tue, 12 Jan 2010 03:17:36 -0500 Subject: [PATCH] Fixed another "minor" bug that caused the entire contents of the items_faces table to get deleted whenever a face-tagged photo is deleted. --- modules/tagfaces/helpers/tagfaces_event.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/tagfaces/helpers/tagfaces_event.php b/modules/tagfaces/helpers/tagfaces_event.php index 77613304..9b9defb4 100644 --- a/modules/tagfaces/helpers/tagfaces_event.php +++ b/modules/tagfaces/helpers/tagfaces_event.php @@ -58,18 +58,24 @@ class tagfaces_event_Core { ->where("item_id", "=", $item->id) ->find_all(); if (count($existingFaces) > 0) { + /* ORM::factory("items_face") ->where("item_id", "=", $item->id) ->delete_all(); + */ + db::build()->delete("items_faces")->where("item_id", "=", $item->id)->execute(); } $existingNotes = ORM::factory("items_note") ->where("item_id", "=", $item->id) ->find_all(); if (count($existingNotes) > 0) { + /* ORM::factory("items_note") ->where("item_id", "=", $item->id) ->delete_all(); + */ + db::build()->delete("items_notes")->where("item_id", "=", $item->id)->execute(); } } }