diff --git a/core/modules/forum/forum-list.tpl.php b/core/modules/forum/forum-list.tpl.php
index 257cea9..a51f450 100644
--- a/core/modules/forum/forum-list.tpl.php
+++ b/core/modules/forum/forum-list.tpl.php
@@ -19,7 +19,6 @@
* - $forum->icon_title: Text alternative for the forum icon.
* - $forum->name: The name of the forum.
* - $forum->link: The URL to link to this forum.
- * - $forum->description: The description of this forum.
* - $forum->new_topics: True if the forum contains unread posts.
* - $forum->new_url: A URL to the forum's unread posts.
* - $forum->new_text: Text for the above URL which tells how many new posts.
@@ -54,9 +53,6 @@
icon_title; ?>
- description): ?>
- description; ?>
-
', $forum->depth); ?>
is_container): ?>
diff --git a/core/modules/forum/forum.test b/core/modules/forum/forum.test
index c7c3d9c..97d8fac 100644
--- a/core/modules/forum/forum.test
+++ b/core/modules/forum/forum.test
@@ -298,13 +298,11 @@ class ForumTestCase extends DrupalWebTestCase {
* taxonomy_term_data created.
*/
function createForum($type, $parent = 0) {
- // Generate a random name/description.
+ // Generate a random name.
$name = $this->randomName(10);
- $description = $this->randomName(100);
$edit = array(
'name' => $name,
- 'description' => $description,
'parent[0]' => $parent,
'weight' => '0',
);
@@ -316,7 +314,7 @@ class ForumTestCase extends DrupalWebTestCase {
$this->assertRaw(t('Created new @type %term.', array('%term' => $name, '@type' => t($type))), t(ucfirst($type) . ' was created'));
// Verify forum.
- $term = db_query("SELECT * FROM {taxonomy_term_data} t WHERE t.vid = :vid AND t.name = :name AND t.description = :desc", array(':vid' => variable_get('forum_nav_vocabulary', ''), ':name' => $name, ':desc' => $description))->fetchAssoc();
+ $term = db_query("SELECT * FROM {taxonomy_term_data} t WHERE t.vid = :vid AND t.name = :name", array(':vid' => variable_get('forum_nav_vocabulary', ''), ':name' => $name)->fetchAssoc();
$this->assertTrue(!empty($term), 'The ' . $type . ' exists in the database');
// Verify forum hierarchy.
diff --git a/core/modules/path/path.test b/core/modules/path/path.test
index ba86b79..8d9086c 100644
--- a/core/modules/path/path.test
+++ b/core/modules/path/path.test
@@ -190,16 +190,15 @@ class PathTaxonomyTermTestCase extends DrupalWebTestCase {
function testTermAlias() {
// Create a term in the default 'Tags' vocabulary with URL alias.
$vocabulary = taxonomy_vocabulary_load(1);
- $description = $this->randomName();;
+ $name = $this->randomName();;
$edit = array();
- $edit['name'] = $this->randomName();
- $edit['description[value]'] = $description;
+ $edit['name'] = $name;
$edit['path[alias]'] = $this->randomName();
$this->drupalPost('admin/structure/taxonomy/' . $vocabulary->machine_name . '/add', $edit, t('Save'));
// Confirm that the alias works.
$this->drupalGet($edit['path[alias]']);
- $this->assertText($description, 'Term can be accessed on URL alias.');
+ $this->assertText($name, 'Term can be accessed on URL alias.');
// Change the term's URL alias.
$tid = db_query("SELECT tid FROM {taxonomy_term_data} WHERE name = :name", array(':name' => $edit['name']))->fetchField();
@@ -209,11 +208,11 @@ class PathTaxonomyTermTestCase extends DrupalWebTestCase {
// Confirm that the changed alias works.
$this->drupalGet($edit2['path[alias]']);
- $this->assertText($description, 'Term can be accessed on changed URL alias.');
+ $this->assertText($name, 'Term can be accessed on changed URL alias.');
// Confirm that the old alias no longer works.
$this->drupalGet($edit['path[alias]']);
- $this->assertNoText($description, 'Old URL alias has been removed after altering.');
+ $this->assertNoText($name, 'Old URL alias has been removed after altering.');
$this->assertResponse(404, 'Old URL alias returns 404.');
// Remove the term's URL alias.
@@ -223,7 +222,7 @@ class PathTaxonomyTermTestCase extends DrupalWebTestCase {
// Confirm that the alias no longer works.
$this->drupalGet($edit2['path[alias]']);
- $this->assertNoText($description, 'Old URL alias has been removed after altering.');
+ $this->assertNoText($name, 'Old URL alias has been removed after altering.');
$this->assertResponse(404, 'Old URL alias returns 404.');
}
}
diff --git a/core/modules/taxonomy/taxonomy-term.tpl.php b/core/modules/taxonomy/taxonomy-term.tpl.php
index b1ff20e..d7b12ad 100644
--- a/core/modules/taxonomy/taxonomy-term.tpl.php
+++ b/core/modules/taxonomy/taxonomy-term.tpl.php
@@ -6,8 +6,8 @@
*
* Available variables:
* - $name: the (sanitized) name of the term.
- * - $content: An array of items for the content of the term (fields and
- * description). Use render($content) to print them all, or print a subset
+ * - $content: An array of items for the content of the term (fields).
+ * Use render($content) to print them all, or print a subset
* such as render($content['field_example']). Use
* hide($content['field_example']) to temporarily suppress the printing of a
* given element.
diff --git a/core/modules/taxonomy/taxonomy.admin.inc b/core/modules/taxonomy/taxonomy.admin.inc
index bf8a528..66679c2 100644
--- a/core/modules/taxonomy/taxonomy.admin.inc
+++ b/core/modules/taxonomy/taxonomy.admin.inc
@@ -114,8 +114,8 @@ function taxonomy_form_vocabulary($form, &$form_state, $edit = array()) {
$defaults = array(
'name' => '',
'machine_name' => '',
- 'description' => '',
'hierarchy' => TAXONOMY_HIERARCHY_DISABLED,
+ 'description' => '',
'weight' => 0,
);
foreach ($defaults as $key => $value) {
@@ -654,8 +654,6 @@ function taxonomy_form_term($form, &$form_state, $edit = array(), $vocabulary =
}
$defaults = array(
'name' => '',
- 'description' => '',
- 'format' => NULL,
'vocabulary_machine_name' => isset($vocabulary) ? $vocabulary->machine_name : NULL,
'tid' => NULL,
'weight' => 0,
@@ -687,13 +685,6 @@ function taxonomy_form_term($form, &$form_state, $edit = array(), $vocabulary =
'#required' => TRUE,
'#weight' => -5,
);
- $form['description'] = array(
- '#type' => 'text_format',
- '#title' => t('Description'),
- '#default_value' => $term->description,
- '#format' => $term->format,
- '#weight' => 0,
- );
$form['vocabulary_machine_name'] = array(
'#type' => 'value',
@@ -850,10 +841,6 @@ function taxonomy_form_term_submit_build_taxonomy_term($form, &$form_state) {
$term = $form_state['term'];
entity_form_submit_build_entity('taxonomy_term', $term, $form, $form_state);
- // Convert text_format field into values expected by taxonomy_term_save().
- $description = $form_state['values']['description'];
- $term->description = $description['value'];
- $term->format = $description['format'];
return $term;
}
diff --git a/core/modules/taxonomy/taxonomy.css b/core/modules/taxonomy/taxonomy.css
index 36cd641..fcfef82 100644
--- a/core/modules/taxonomy/taxonomy.css
+++ b/core/modules/taxonomy/taxonomy.css
@@ -8,6 +8,3 @@ tr.taxonomy-term-divider-top {
tr.taxonomy-term-divider-bottom {
border-top: 1px dotted #CCC;
}
-.taxonomy-term-description {
- margin: 5px 0 20px;
-}
diff --git a/core/modules/taxonomy/taxonomy.install b/core/modules/taxonomy/taxonomy.install
index 3e07259..d7984a8 100644
--- a/core/modules/taxonomy/taxonomy.install
+++ b/core/modules/taxonomy/taxonomy.install
@@ -47,19 +47,6 @@ function taxonomy_schema() {
'description' => 'The term name.',
'translatable' => TRUE,
),
- 'description' => array(
- 'type' => 'text',
- 'not null' => FALSE,
- 'size' => 'big',
- 'description' => 'A description of the term.',
- 'translatable' => TRUE,
- ),
- 'format' => array(
- 'type' => 'varchar',
- 'length' => 255,
- 'not null' => FALSE,
- 'description' => 'The {filter_format}.format of the description.',
- ),
'weight' => array(
'type' => 'int',
'not null' => TRUE,
@@ -245,4 +232,79 @@ function taxonomy_field_schema($field) {
*/
function taxonomy_update_8000() {
db_drop_field('taxonomy_vocabulary', 'module');
-}
\ No newline at end of file
+}
+
+/**
+ * Create new field for term descriptions.
+ */
+function taxonomy_update_8001() {
+ $vocabularies = taxonomy_vocabulary_load_multiple(FALSE);
+ if (count($vocabularies)) {
+ // Create a new term description field..
+ $field = array(
+ 'field_name' => 'taxonomy_term_description',
+ 'type' => 'text_long',
+ 'entity_types' => array('taxonomy_term'),
+ );
+ field_create_field($field);
+
+ // Create instances for existing vocabularies.
+ foreach ($vocabularies as $vocabulary) {
+ // Attaches the description field to each bundle.
+ $instance = array(
+ 'field_name' => 'taxonomy_term_description',
+ 'label' => 'Description',
+ 'entity_type' => 'taxonomy_term',
+ 'bundle' => $vocabulary->machine_name,
+ 'settings' => array('text_processing' => 1),
+ 'display' => array(
+ 'default' => array(
+ 'label' => 'hidden',
+ 'type' => 'text_default',
+ 'weight' => 0,
+ ),
+ ),
+ );
+ field_create_instance($instance);
+ }
+ }
+}
+
+/**
+ * Move term descriptions in {term_data}.description into new field.
+ */
+function taxonomy_update_8002(&$sandbox) {
+ if (!isset($sandbox['progress'])) {
+ $sandbox['progress'] = 0;
+ $sandbox['current_tid'] = 0;
+ $sandbox['max'] = db_query('SELECT COUNT(DISTINCT tid) FROM {taxonomy_term_data}')->fetchField();
+ }
+
+ $terms = db_select('taxonomy_term_data', 't')
+ ->fields('t', array('tid', 'description', 'format'))
+ ->condition('tid', $sandbox['current_tid'], '>')
+ ->range(0, 100)
+ ->orderBy('tid', 'ASC')
+ ->execute();
+
+ foreach ($terms as $term) {
+ $description = $term->description;
+ $format = $term->format;
+ $term = taxonomy_term_load($term->tid);
+ $term->taxonomy_term_description['und'][0]['value'] = $description;
+ $term->taxonomy_term_description['und'][0]['format'] = $format;
+ taxonomy_term_save($term);
+ $sandbox['progress']++;
+ $sandbox['current_tid'] = $term->tid;
+ }
+
+ $sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['progress'] / $sandbox['max']);
+}
+
+/**
+ * Remove {term_data}.description and {term_data}.format.
+ */
+function taxonomy_update_8003() {
+ db_drop_field('taxonomy_term_data', 'description');
+ db_drop_field('taxonomy_term_data', 'format');
+}
diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module
index 3a9258b..66e62eb 100644
--- a/core/modules/taxonomy/taxonomy.module
+++ b/core/modules/taxonomy/taxonomy.module
@@ -177,18 +177,6 @@ function taxonomy_field_extra_fields() {
'description' => t('Term name textfield'),
'weight' => -5,
),
- 'description' => array(
- 'label' => t('Description'),
- 'description' => t('Term description textarea'),
- 'weight' => 0,
- ),
- ),
- 'display' => array(
- 'description' => array(
- 'label' => t('Description'),
- 'description' => t('Term description'),
- 'weight' => 0,
- ),
),
);
}
@@ -616,8 +604,6 @@ function taxonomy_check_vocabulary_hierarchy($vocabulary, $changed_term) {
* - name: The name of the term.
* - tid: (optional) The unique ID for the term being saved. If $term->tid is
* empty or omitted, a new term will be inserted.
- * - description: (optional) The term's description.
- * - format: (optional) The text format for the term's description.
* - weight: (optional) The weight of this term in relation to other terms
* within the same vocabulary.
* - parent: (optional) The parent term(s) for this term. This can be a single
@@ -804,16 +790,6 @@ function taxonomy_term_view($term, $view_mode = 'full', $langcode = NULL) {
$build += field_attach_view('taxonomy_term', $term, $view_mode, $langcode);
- // Add term description if the term has one.
- if (!empty($term->description)) {
- $build['description'] = array(
- '#markup' => check_markup($term->description, $term->format, '', TRUE),
- '#weight' => 0,
- '#prefix' => '',
- '#suffix' => '
',
- );
- }
-
$build['#attached']['css'][] = drupal_get_path('module', 'taxonomy') . '/taxonomy.css';
// Allow modules to modify the structured term.
diff --git a/core/modules/taxonomy/taxonomy.pages.inc b/core/modules/taxonomy/taxonomy.pages.inc
index e1b47a9..96c9c03 100644
--- a/core/modules/taxonomy/taxonomy.pages.inc
+++ b/core/modules/taxonomy/taxonomy.pages.inc
@@ -68,9 +68,6 @@ function taxonomy_term_page($term) {
function taxonomy_term_feed($term) {
$channel['link'] = url('taxonomy/term/' . $term->tid, array('absolute' => TRUE));
$channel['title'] = variable_get('site_name', 'Drupal') . ' - ' . $term->name;
- // Only display the description if we have a single term, to avoid clutter and confusion.
- // HTML will be removed from feed description.
- $channel['description'] = check_markup($term->description, $term->format, '', TRUE);
$nids = taxonomy_select_nodes($term->tid, FALSE, variable_get('feed_default_items', 10));
node_feed($nids, $channel);
diff --git a/core/modules/taxonomy/taxonomy.test b/core/modules/taxonomy/taxonomy.test
index 0ef4758..b551172 100644
--- a/core/modules/taxonomy/taxonomy.test
+++ b/core/modules/taxonomy/taxonomy.test
@@ -32,9 +32,6 @@ class TaxonomyWebTestCase extends DrupalWebTestCase {
function createTerm($vocabulary) {
$term = new stdClass();
$term->name = $this->randomName();
- $term->description = $this->randomName();
- // Use the first available text format.
- $term->format = db_query_range('SELECT format FROM {filter_format}', 0, 1)->fetchField();
$term->vid = $vocabulary->vid;
taxonomy_term_save($term);
return $term;
@@ -722,7 +719,6 @@ class TaxonomyTermTestCase extends TaxonomyWebTestCase {
function testTermInterface() {
$edit = array(
'name' => $this->randomName(12),
- 'description[value]' => $this->randomName(100),
);
// Explicitly set the parents field to 'root', to ensure that
// taxonomy_form_term_submit() handles the invalid term ID correctly.
@@ -744,11 +740,9 @@ class TaxonomyTermTestCase extends TaxonomyWebTestCase {
$this->clickLink(t('edit'));
$this->assertRaw($edit['name'], t('The randomly generated term name is present.'));
- $this->assertText($edit['description[value]'], t('The randomly generated term description is present.'));
$edit = array(
'name' => $this->randomName(14),
- 'description[value]' => $this->randomName(102),
);
// Edit the term.
@@ -762,15 +756,6 @@ class TaxonomyTermTestCase extends TaxonomyWebTestCase {
// View the term and check that it is correct.
$this->drupalGet('taxonomy/term/' . $term->tid);
$this->assertText($edit['name'], t('The randomly generated term name is present.'));
- $this->assertText($edit['description[value]'], t('The randomly generated term description is present.'));
-
- // Did this page request display a 'term-listing-heading'?
- $this->assertPattern('|class="taxonomy-term-description"|', 'Term page displayed the term description element.');
- // Check that it does NOT show a description when description is blank.
- $term->description = '';
- taxonomy_term_save($term);
- $this->drupalGet('taxonomy/term/' . $term->tid);
- $this->assertNoPattern('|class="taxonomy-term-description"|', 'Term page did not display the term description when description was blank.');
// Check that the term feed page is working.
$this->drupalGet('taxonomy/term/' . $term->tid . '/feed');
@@ -857,7 +842,6 @@ class TaxonomyTermTestCase extends TaxonomyWebTestCase {
// Add a new term with multiple parents.
$edit = array(
'name' => $this->randomName(12),
- 'description[value]' => $this->randomName(100),
'parent[]' => array(0, $parent->tid),
);
// Save the new term.
@@ -868,7 +852,6 @@ class TaxonomyTermTestCase extends TaxonomyWebTestCase {
$term = reset($terms);
$this->assertNotNull($term, t('Term found in database'));
$this->assertEqual($edit['name'], $term->name, t('Term name was successfully saved.'));
- $this->assertEqual($edit['description[value]'], $term->description, t('Term description was successfully saved.'));
// Check that the parent tid is still there. The other parent () is
// not added by taxonomy_term_load_parents().
$parents = taxonomy_term_load_parents($term->tid);
@@ -1587,7 +1570,6 @@ class TaxonomyTokenReplaceTestCase extends TaxonomyWebTestCase {
$tests = array();
$tests['[term:tid]'] = $term1->tid;
$tests['[term:name]'] = check_plain($term1->name);
- $tests['[term:description]'] = check_markup($term1->description, $term1->format);
$tests['[term:url]'] = url('taxonomy/term/' . $term1->tid, array('absolute' => TRUE));
$tests['[term:node-count]'] = 0;
$tests['[term:parent:name]'] = '[term:parent:name]';
@@ -1602,7 +1584,6 @@ class TaxonomyTokenReplaceTestCase extends TaxonomyWebTestCase {
$tests = array();
$tests['[term:tid]'] = $term2->tid;
$tests['[term:name]'] = check_plain($term2->name);
- $tests['[term:description]'] = check_markup($term2->description, $term2->format);
$tests['[term:url]'] = url('taxonomy/term/' . $term2->tid, array('absolute' => TRUE));
$tests['[term:node-count]'] = 1;
$tests['[term:parent:name]'] = check_plain($term1->name);
@@ -1620,7 +1601,6 @@ class TaxonomyTokenReplaceTestCase extends TaxonomyWebTestCase {
// Generate and test unsanitized tokens.
$tests['[term:name]'] = $term2->name;
- $tests['[term:description]'] = $term2->description;
$tests['[term:parent:name]'] = $term1->name;
$tests['[term:vocabulary:name]'] = $this->vocabulary->name;
diff --git a/core/modules/taxonomy/taxonomy.tokens.inc b/core/modules/taxonomy/taxonomy.tokens.inc
index 24d7bc8..ecd4219 100644
--- a/core/modules/taxonomy/taxonomy.tokens.inc
+++ b/core/modules/taxonomy/taxonomy.tokens.inc
@@ -29,10 +29,6 @@ function taxonomy_token_info() {
'name' => t("Name"),
'description' => t("The name of the taxonomy term."),
);
- $term['description'] = array(
- 'name' => t("Description"),
- 'description' => t("The optional description of the taxonomy term."),
- );
$term['node-count'] = array(
'name' => t("Node count"),
'description' => t("The number of nodes tagged with the taxonomy term."),
@@ -105,10 +101,6 @@ function taxonomy_tokens($type, $tokens, array $data = array(), array $options =
$replacements[$original] = $sanitize ? check_plain($term->name) : $term->name;
break;
- case 'description':
- $replacements[$original] = $sanitize ? check_markup($term->description, $term->format, '', TRUE) : $term->description;
- break;
-
case 'url':
$uri = entity_uri('taxonomy_term', $term);
$replacements[$original] = url($uri['path'], array_merge($uri['options'], array('absolute' => TRUE)));