diff --git a/modules/taxonomy.module b/modules/taxonomy.module index e484dad278a..cee760d4f50 100644 --- a/modules/taxonomy.module +++ b/modules/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"])); diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index e484dad278a..cee760d4f50 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"]));