summaryrefslogtreecommitdiff
path: root/modules/taxonomy.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/taxonomy.module')
-rw-r--r--modules/taxonomy.module4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/taxonomy.module b/modules/taxonomy.module
index e484dad27..cee760d4f 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"]));