Commit 167cf56a authored by Dries's avatar Dries
Browse files

- Fixed warning when creating a vocabulary with no types.  Reported by Gerhard,
  patch by Marco.
parent a31c3297
...@@ -93,7 +93,11 @@ function taxonomy_form_vocabulary($edit = array()) { ...@@ -93,7 +93,11 @@ function taxonomy_form_vocabulary($edit = array()) {
} }
function taxonomy_save_vocabulary($edit) { 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["types"]) {
$edit["types"] = array();
}
$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"]) { if ($edit["vid"] && $edit["name"]) {
db_query("UPDATE vocabulary SET ". _prepare_update($data) ." WHERE vid = %d", $edit["vid"]); db_query("UPDATE vocabulary SET ". _prepare_update($data) ." WHERE vid = %d", $edit["vid"]);
module_invoke_all("taxonomy", "update", "vocabulary", $edit); module_invoke_all("taxonomy", "update", "vocabulary", $edit);
......
...@@ -93,7 +93,11 @@ function taxonomy_form_vocabulary($edit = array()) { ...@@ -93,7 +93,11 @@ function taxonomy_form_vocabulary($edit = array()) {
} }
function taxonomy_save_vocabulary($edit) { 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["types"]) {
$edit["types"] = array();
}
$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"]) { if ($edit["vid"] && $edit["name"]) {
db_query("UPDATE vocabulary SET ". _prepare_update($data) ." WHERE vid = %d", $edit["vid"]); db_query("UPDATE vocabulary SET ". _prepare_update($data) ." WHERE vid = %d", $edit["vid"]);
module_invoke_all("taxonomy", "update", "vocabulary", $edit); module_invoke_all("taxonomy", "update", "vocabulary", $edit);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment