summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-04-08 11:07:57 +0000
committerDries Buytaert <dries@buytaert.net>2005-04-08 11:07:57 +0000
commit38eef18e98b4b546ce9e641f3b0c6284468c651c (patch)
tree90c3c7584910316bbc2a81ac4cfcf91c3e83c749 /modules
parent0f41706acc230a03e241b302d46b552e801770d0 (diff)
downloadbrdo-38eef18e98b4b546ce9e641f3b0c6284468c651c.tar.gz
brdo-38eef18e98b4b546ce9e641f3b0c6284468c651c.tar.bz2
- Patch #19615 by chx: fixed problem forum container getting lets when editing a forum.
Diffstat (limited to 'modules')
-rw-r--r--modules/forum.module14
-rw-r--r--modules/forum/forum.module14
2 files changed, 18 insertions, 10 deletions
diff --git a/modules/forum.module b/modules/forum.module
index 40b8b6841..3c4d7d74e 100644
--- a/modules/forum.module
+++ b/modules/forum.module
@@ -193,6 +193,14 @@ function forum_form_forum($edit = array()) {
function _forum_parent_select($tid, $title, $name) {
$parents = taxonomy_get_parents($tid);
+ if ($parents) {
+ $parent = array_shift($parents);
+ $parent = $parent->tid;
+ }
+ else {
+ $parent = 0;
+ }
+
$children = taxonomy_get_tree(_forum_get_vid, $tid);
// A term can't be the child of itself, nor of its children.
@@ -211,11 +219,7 @@ function _forum_parent_select($tid, $title, $name) {
}
}
- if (!$parents) {
- $parents = 0;
- }
-
- return form_select($title, $name, $parents, $options, NULL, 0, FALSE, TRUE);
+ return form_select($title, $name, $parent, $options, NULL, 0, FALSE, TRUE);
}
/**
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index 40b8b6841..3c4d7d74e 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -193,6 +193,14 @@ function forum_form_forum($edit = array()) {
function _forum_parent_select($tid, $title, $name) {
$parents = taxonomy_get_parents($tid);
+ if ($parents) {
+ $parent = array_shift($parents);
+ $parent = $parent->tid;
+ }
+ else {
+ $parent = 0;
+ }
+
$children = taxonomy_get_tree(_forum_get_vid, $tid);
// A term can't be the child of itself, nor of its children.
@@ -211,11 +219,7 @@ function _forum_parent_select($tid, $title, $name) {
}
}
- if (!$parents) {
- $parents = 0;
- }
-
- return form_select($title, $name, $parents, $options, NULL, 0, FALSE, TRUE);
+ return form_select($title, $name, $parent, $options, NULL, 0, FALSE, TRUE);
}
/**