public
Description: The ultra-lightweight ultra-flexible blogging engine with a fetish for birds and misspellings.
Homepage: http://chyrp.net/
Clone URL: git://github.com/vito/chyrp.git
Click here to lend your support to: chyrp and make a donation at www.pledgie.com !
Deleting a tag should delete the row if it's the only tag.
vito (author)
Mon Sep 01 09:51:34 -0700 2008
commit  0ab14775db15b0805c1f2192b79edcc6247ad196
tree    29808ae1f236faefb2168d76613b0113d4ba22ef
parent  a78f76381f44057814538388890bed5f3127c379
...
310
311
312
313
314
315
316
317
318
319
 
 
 
 
 
 
 
 
 
 
320
321
322
...
310
311
312
 
 
 
 
 
 
 
313
314
315
316
317
318
319
320
321
322
323
324
325
0
@@ -310,13 +310,16 @@
0
           if ($clean != $_GET['clean'])
0
             $cleans[] = "{{".$clean."}}";
0
 
0
-        $sql->update("tags",
0
-                     "id = :id",
0
-                     array("tags" => ":tags",
0
-                           "clean" => ":clean"),
0
-                     array(":id" => $tag["id"],
0
-                           ":tags" => join(",", $names),
0
-                           ":clean" => join(",", $cleans)));
0
+        if (empty($names) or empty($cleans))
0
+          $sql->delete("tags", array("id" => $tag["id"]));
0
+        else
0
+          $sql->update("tags",
0
+                       "id = :id",
0
+                       array("tags" => ":tags",
0
+                             "clean" => ":clean"),
0
+                       array(":id" => $tag["id"],
0
+                             ":tags" => join(",", $names),
0
+                             ":clean" => join(",", $cleans)));
0
       }
0
 
0
       Flash::notice(__("Tag deleted.", "tags"), "/admin/?action=manage_tags");

Comments