From 902cfcad257fb45f1ce3243f3846c03f0e9d4912 Mon Sep 17 00:00:00 2001 From: shish Date: Sat, 5 Jan 2008 00:45:07 +0000 Subject: [PATCH] stable too git-svn-id: file:///home/shish/svn/shimmie2/branches/branch_2.1@691 7f39781d-f577-437e-ae19-be835c7a54ca --- ext/tag_edit/main.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/tag_edit/main.php b/ext/tag_edit/main.php index dcf941d0..a413bdff 100644 --- a/ext/tag_edit/main.php +++ b/ext/tag_edit/main.php @@ -94,6 +94,11 @@ class TagEdit extends Extension { // FIXME: what if the (image_id,tag_id) pair already exists? $database->Execute("UPDATE IGNORE image_tags SET tag_id=? WHERE tag_id=?", Array($replace_id, $search_id)); $database->Execute("DELETE FROM image_tags WHERE tag_id=?", Array($search_id)); + $database->Execute(" + UPDATE tags + SET count=(SELECT COUNT(image_id) FROM image_tags WHERE tag_id=tags.id GROUP BY tag_id) + WHERE id=? + ", array($replace_id)); } else if($search_id) { $database->Execute("UPDATE tags SET tag=? WHERE tag=?", Array($replace, $search));