From dc3df675906d2a0723e43c7ddfab56d46167eeed Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 13 Jan 2003 19:35:16 +0000 Subject: - Small bugfix and small cleanup. Patch by Marco. --- modules/taxonomy/taxonomy.module | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/taxonomy/taxonomy.module') diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index e484dad27..cee760d4f 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -87,7 +87,7 @@ function taxonomy_save_vocabulary($edit) { $data = array("name" => $edit["name"], "types" => @implode(",", $edit["types"]), "description" => $edit["description"], "multiple" => $edit["multiple"], "required" => $edit["required"], "hierarchy" => $edit["hierarchy"], "relations" => $edit["relations"], "weight" => $edit["weight"]); if ($edit["vid"] && $edit["name"]) { - db_query("UPDATE vocabulary SET ". _prepare_update($data) ." WHERE vid = '". check_query($edit["vid"]) ."'"); + db_query("UPDATE vocabulary SET ". _prepare_update($data) ." WHERE vid = '%d'", $edit["vid"]); module_invoke_all("taxonomy", "update", "vocabulary", $edit); $message = t("updated vocabulary '%name'.", array("%name" => $edit["name"])); } @@ -95,7 +95,7 @@ function taxonomy_save_vocabulary($edit) { $message = taxonomy_del_vocabulary($edit["vid"]); } else { - $data["vid"] = db_next_id("vocabulary"); + $data["vid"] = $edit["vid"] = db_next_id("vocabulary"); db_query("INSERT INTO vocabulary ". _prepare_insert($data, 1) ." VALUES ". _prepare_insert($data, 2)); module_invoke_all("taxonomy", "insert", "vocabulary", $edit); $message = t("created new vocabulary '%name'.", array("%name" => $edit["name"])); -- cgit v1.2.3