summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/forum.module7
-rw-r--r--modules/forum/forum.module7
-rw-r--r--modules/taxonomy.module5
-rw-r--r--modules/taxonomy/taxonomy.module5
4 files changed, 10 insertions, 14 deletions
diff --git a/modules/forum.module b/modules/forum.module
index 2790f5be7..7e36b4087 100644
--- a/modules/forum.module
+++ b/modules/forum.module
@@ -592,12 +592,9 @@ function forum_form(&$node) {
$node->taxonomy[] = arg(3);
}
else {
- $node->taxonomy = array($node->tid);
- }
-
- if ($node->nid) {
+ $forum_terms = taxonomy_node_get_terms_by_vocabulary(_forum_get_vid(), $node->nid);
// if editing, give option to leave shadows
- $shadow = (count(taxonomy_node_get_terms($node->nid)) > 1);
+ $shadow = (count($forum_terms) > 1);
$form['shadow'] = array('#type' => 'checkbox', '#title' => t('Leave shadow copy'), '#default_value' => $shadow, '#description' => t('If you move this topic, you can leave a link in the old forum to the new forum.'));
}
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index 2790f5be7..7e36b4087 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -592,12 +592,9 @@ function forum_form(&$node) {
$node->taxonomy[] = arg(3);
}
else {
- $node->taxonomy = array($node->tid);
- }
-
- if ($node->nid) {
+ $forum_terms = taxonomy_node_get_terms_by_vocabulary(_forum_get_vid(), $node->nid);
// if editing, give option to leave shadows
- $shadow = (count(taxonomy_node_get_terms($node->nid)) > 1);
+ $shadow = (count($forum_terms) > 1);
$form['shadow'] = array('#type' => 'checkbox', '#title' => t('Leave shadow copy'), '#default_value' => $shadow, '#description' => t('If you move this topic, you can leave a link in the old forum to the new forum.'));
}
diff --git a/modules/taxonomy.module b/modules/taxonomy.module
index a3f3a796d..5b4bd3627 100644
--- a/modules/taxonomy.module
+++ b/modules/taxonomy.module
@@ -498,7 +498,7 @@ function taxonomy_form_alter($form_id, &$form) {
if (isset($form['type']) && $form['type']['#value'] .'_node_form' == $form_id) {
$node = $form['#node'];
- if (!array_key_exists('taxonomy', $node)) {
+ if (!isset($node->taxonomy)) {
if ($node->nid) {
$terms = taxonomy_node_get_terms($node->nid);
}
@@ -531,7 +531,8 @@ function taxonomy_form_alter($form_id, &$form) {
$form['taxonomy']['tags'][$vocabulary->vid] = array('#type' => 'textfield', '#default_value' => $typed_string, '#maxlength' => 100, '#autocomplete_path' => 'taxonomy/autocomplete/'. $vocabulary->vid, '#required' => $vocabulary->required, '#title' => $vocabulary->name, '#description' => t('A comma-separated list of terms describing this content (Example: funny, bungie jumping, "Company, Inc.").'));
}
else {
- $ntterms = array_key_exists('taxonomy', $node) ? $terms : array_keys($terms);
+ $ntterms = isset($node->taxonomy) ? $terms : array_keys($terms);
+
$form['taxonomy'][$vocabulary->vid] = taxonomy_form($vocabulary->vid, $ntterms, $help, 'taxonomy');
}
}
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index a3f3a796d..5b4bd3627 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -498,7 +498,7 @@ function taxonomy_form_alter($form_id, &$form) {
if (isset($form['type']) && $form['type']['#value'] .'_node_form' == $form_id) {
$node = $form['#node'];
- if (!array_key_exists('taxonomy', $node)) {
+ if (!isset($node->taxonomy)) {
if ($node->nid) {
$terms = taxonomy_node_get_terms($node->nid);
}
@@ -531,7 +531,8 @@ function taxonomy_form_alter($form_id, &$form) {
$form['taxonomy']['tags'][$vocabulary->vid] = array('#type' => 'textfield', '#default_value' => $typed_string, '#maxlength' => 100, '#autocomplete_path' => 'taxonomy/autocomplete/'. $vocabulary->vid, '#required' => $vocabulary->required, '#title' => $vocabulary->name, '#description' => t('A comma-separated list of terms describing this content (Example: funny, bungie jumping, "Company, Inc.").'));
}
else {
- $ntterms = array_key_exists('taxonomy', $node) ? $terms : array_keys($terms);
+ $ntterms = isset($node->taxonomy) ? $terms : array_keys($terms);
+
$form['taxonomy'][$vocabulary->vid] = taxonomy_form($vocabulary->vid, $ntterms, $help, 'taxonomy');
}
}