? comment_block.png ? comment_fields.patch ? forum.sql ? forum_upgrade.sql ? node.patch ? nodecontroller.patch ? remove_synonyms.patch ? taxonomy.patch ? taxonomy_52.patch ? taxonomy_denormalize.patch ? taxonomy_field.patch ? test.html ? modules/comment/.comment.admin.inc.swp ? sites/default/files ? sites/default/private ? sites/default/settings.php Index: modules/taxonomy/taxonomy.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.admin.inc,v retrieving revision 1.67 diff -u -p -r1.67 taxonomy.admin.inc --- modules/taxonomy/taxonomy.admin.inc 31 Aug 2009 20:44:22 -0000 1.67 +++ modules/taxonomy/taxonomy.admin.inc 3 Sep 2009 17:36:22 -0000 @@ -752,11 +752,6 @@ function taxonomy_form_term(&$form_state $form['advanced']['parent'] = _taxonomy_term_select(t('Parents'), $parent, $vocabulary->vid, t('Parent terms') . '.', 1, '<' . t('root') . '>', $exclude); } - $form['advanced']['synonyms'] = array( - '#type' => 'textarea', - '#title' => t('Synonyms'), - '#default_value' => implode("\n", taxonomy_get_synonyms($edit['tid'])), - '#description' => t('One synonym per line. Text input term selection widgets will show terms whose synonyms match the entered value as suggestions.')); $form['advanced']['weight'] = array( '#type' => 'textfield', '#title' => t('Weight'), Index: modules/taxonomy/taxonomy.install =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.install,v retrieving revision 1.21 diff -u -p -r1.21 taxonomy.install --- modules/taxonomy/taxonomy.install 4 Aug 2009 06:50:07 -0000 1.21 +++ modules/taxonomy/taxonomy.install 3 Sep 2009 17:36:22 -0000 @@ -140,39 +140,6 @@ function taxonomy_schema() { ), 'primary key' => array('tid', 'vid'), ); - $schema['taxonomy_term_synonym'] = array( - 'description' => 'Stores term synonyms.', - 'fields' => array( - 'tsid' => array( - 'type' => 'serial', - 'not null' => TRUE, - 'description' => 'Primary Key: Unique term synonym ID.', - ), - 'tid' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'default' => 0, - 'description' => 'The {taxonomy_term_data}.tid of the term.', - ), - 'name' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'default' => '', - 'description' => 'The name of the synonym.', - ), - ), - 'indexes' => array( - 'tid' => array('tid'), - 'name_tid' => array('name', 'tid'), - ), - 'foreign keys' => array( - 'tid' => array('taxonomy_term_data' => 'tid'), - ), - 'primary key' => array('tsid'), - ); - $schema['taxonomy_vocabulary'] = array( 'description' => 'Stores vocabulary information.', 'fields' => array( Index: modules/taxonomy/taxonomy.module =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v retrieving revision 1.507 diff -u -p -r1.507 taxonomy.module --- modules/taxonomy/taxonomy.module 27 Aug 2009 20:48:31 -0000 1.507 +++ modules/taxonomy/taxonomy.module 3 Sep 2009 17:36:23 -0000 @@ -504,23 +504,6 @@ function taxonomy_term_save($term) { } $query->execute(); - db_delete('taxonomy_term_synonym') - ->condition('tid', $term->tid) - ->execute(); - if (!empty($term->synonyms)) { - $query = db_insert('taxonomy_term_synonym') - ->fields(array('tid', 'name')); - foreach (explode ("\n", str_replace("\r", '', $term->synonyms)) as $synonym) { - if ($synonym) { - $query->values(array( - 'tid' => $term->tid, - 'name' => rtrim($synonym) - )); - } - } - $query->execute(); - } - cache_clear_all(); taxonomy_terms_static_reset(); @@ -559,9 +542,6 @@ function taxonomy_term_delete($tid) { db_delete('taxonomy_term_hierarchy') ->condition('tid', $tid) ->execute(); - db_delete('taxonomy_term_synonym') - ->condition('tid', $tid) - ->execute(); db_delete('taxonomy_term_node') ->condition('tid', $tid) ->execute(); @@ -586,7 +566,6 @@ function taxonomy_term_delete($tid) { function taxonomy_terms_static_reset() { drupal_static_reset('taxonomy_term_count_nodes'); drupal_static_reset('taxonomy_get_tree'); - drupal_static_reset('taxonomy_get_synonym_root'); entity_get_controller('taxonomy_term')->resetCache(); } @@ -1127,36 +1106,6 @@ function taxonomy_get_tree($vid, $parent } /** - * Return an array of synonyms of the given term ID. - */ -function taxonomy_get_synonyms($tid) { - if ($tid) { - $synonyms = array(); - return db_query('SELECT name FROM {taxonomy_term_synonym} WHERE tid = :tid', array(':tid' => $tid))->fetchCol(); - } - else { - return array(); - } -} - -/** - * Return the term object that has the given string as a synonym. - * - * @param $synonym - * The string to compare against. - * @return - * A term object, or FALSE if no matching term is found. - */ -function taxonomy_get_synonym_root($synonym) { - $synonyms = &drupal_static(__FUNCTION__, array()); - - if (!isset($synonyms[$synonym])) { - $synonyms[$synonym] = db_query("SELECT * FROM {taxonomy_term_synonym} s, {taxonomy_term_data} t WHERE t.tid = s.tid AND s.name = :name", array(':name' => $synonym))->fetch(); - } - return $synonyms[$synonym]; -} - -/** * Count the number of published nodes classified by a term. * * @param $tid @@ -1657,7 +1606,6 @@ function taxonomy_help($path, $arg) { $output .= '
' . t('Preparation Time: 0-30mins, 30-60mins, 1-2 hrs, 2hrs+') . '
'; $output .= '' . t("Each taxonomy term (often called a 'category' or 'tag' in other systems) automatically provides lists of posts and a corresponding RSS feed. These taxonomy/term URLs can be manipulated to generate AND and OR lists of posts classified with terms. In our recipe site example, it then becomes easy to create pages displaying 'Main courses', '30 minute recipes', or '30 minute main courses and appetizers' by using terms on their own or in combination with others. There are a significant number of contributed modules which you to alter and extend the behavior of the core module for both display and organization of terms.") . '
'; $output .= '' . t("Terms can also be organized in parent/child relationships from the admin interface. An example would be a vocabulary grouping countries under their parent geo-political regions. The taxonomy module also enables advanced implementations of hierarchy, for example placing Turkey in both the 'Middle East' and 'Europe'.") . '
'; - $output .= '' . t('The taxonomy module supports the use of both synonyms and related terms, but does not directly use this functionality. However, optional contributed or custom modules may make full use of these advanced features.') . '
'; $output .= '' . t('For more information, see the online handbook entry for Taxonomy module.', array('@taxonomy' => 'http://drupal.org/handbook/modules/taxonomy/')) . '
'; return $output; case 'admin/structure/taxonomy': Index: modules/taxonomy/taxonomy.test =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.test,v retrieving revision 1.46 diff -u -p -r1.46 taxonomy.test --- modules/taxonomy/taxonomy.test 25 Aug 2009 21:53:48 -0000 1.46 +++ modules/taxonomy/taxonomy.test 3 Sep 2009 17:36:23 -0000 @@ -394,25 +394,6 @@ class TaxonomyTermTestCase extends Taxon } /** - * Test synonyms. - */ - function testTaxonomySynonyms() { - // Create a taxonomy term with one synonym. - $term = $this->createTerm($this->vocabulary); - $term->synonyms = $this->randomName(); - taxonomy_term_save($term); - - // Fetch the synonyms. - $synonyms = taxonomy_get_synonyms($term->tid); - $count = count($synonyms); - $this->assertEqual($count, 1, t('@count synonyms were found.', array('@count' => $count))); - - // Fetch the term using the synonyms. - $returned_term = taxonomy_get_synonym_root($synonyms[0]); - $this->assertEqual($term->tid, $returned_term->tid, t('Term ID returned correctly')); - } - - /** * Test terms in a single and multiple hierarchy. */ function testTaxonomyTermHierarchy() {