summaryrefslogtreecommitdiff
path: root/modules/taxonomy
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2008-11-13 08:13:56 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2008-11-13 08:13:56 +0000
commit939a1f01a14bb9d764a6379d84c0963f23586ad3 (patch)
treecab8b9e3b0851f59b8e5cdb97893f48d46db820e /modules/taxonomy
parentd8aafce20dc57e43eed2e469dd60b0ddf3d6a23d (diff)
downloadbrdo-939a1f01a14bb9d764a6379d84c0963f23586ad3.tar.gz
brdo-939a1f01a14bb9d764a6379d84c0963f23586ad3.tar.bz2
#332145 by catch and Arancaytar: Fix regression on term submit form.
Diffstat (limited to 'modules/taxonomy')
-rw-r--r--modules/taxonomy/taxonomy.admin.inc2
-rw-r--r--modules/taxonomy/taxonomy.module2
-rw-r--r--modules/taxonomy/taxonomy.test3
3 files changed, 5 insertions, 2 deletions
diff --git a/modules/taxonomy/taxonomy.admin.inc b/modules/taxonomy/taxonomy.admin.inc
index af96fda63..938a32609 100644
--- a/modules/taxonomy/taxonomy.admin.inc
+++ b/modules/taxonomy/taxonomy.admin.inc
@@ -766,7 +766,7 @@ function taxonomy_form_term_submit($form, &$form_state) {
$current_parent_count = count($form_state['values']['parent']);
$previous_parent_count = count($form['#term']['parent']);
// Root doesn't count if it's the only parent.
- if ($current_parent_count == 1 && isset($form_state['values']['parent'][''])) {
+ if ($current_parent_count == 1 && isset($form_state['values']['parent'][0])) {
$current_parent_count = 0;
$form_state['values']['parent'] = array();
}
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index 2ed3de9df..b68a63949 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -1089,7 +1089,7 @@ function _taxonomy_term_select($title, $name, $value, $vocabulary_id, $descripti
$options = array();
if ($blank) {
- $options[''] = $blank;
+ $options[0] = $blank;
}
if ($tree) {
foreach ($tree as $term) {
diff --git a/modules/taxonomy/taxonomy.test b/modules/taxonomy/taxonomy.test
index 7f34de9de..a128edee5 100644
--- a/modules/taxonomy/taxonomy.test
+++ b/modules/taxonomy/taxonomy.test
@@ -595,6 +595,9 @@ class TermEditTestCase extends DrupalWebTestCase {
'name' => $this->randomName(12),
'description' => $this->randomName(100),
);
+ // Explictly set the parents field to 'root', to ensure that
+ // taxonomy_form_term_submit() handles the invalid term ID correctly.
+ $edit['parent[]'] = 0;
// Create the term to edit (adding to the default 'Tags' vocabulary).
$this->drupalPost('admin/content/taxonomy/1/add/', $edit, t('Save'));