- Small bugfix and small cleanup. Patch by Marco.

4.2.x
Dries Buytaert 2003-01-13 19:35:16 +00:00
parent 81efba930f
commit dc3df67590
2 changed files with 4 additions and 4 deletions

View File

@ -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"]));

View File

@ -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"]));