? 302440-2.patch ? taxonomy_list_plus_test.patch ? term.patch ? modules/taxonomy/.taxonomy.module.swp ? sites/default/files ? sites/default/settings.php Index: modules/node/node.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.admin.inc,v retrieving revision 1.24 diff -u -p -r1.24 node.admin.inc --- modules/node/node.admin.inc 19 Jul 2008 19:04:24 -0000 1.24 +++ modules/node/node.admin.inc 8 Sep 2008 21:50:25 -0000 @@ -156,7 +156,7 @@ function node_filters() { // The taxonomy filter if ($taxonomy = module_invoke('taxonomy', 'form_all', 1)) { - $filters['category'] = array('title' => t('category'), 'options' => $taxonomy); + $filters['term'] = array('title' => t('term'), 'options' => $taxonomy); } // Language filter if there is a list of languages if ($languages = module_invoke('locale', 'language_list')) { @@ -183,7 +183,7 @@ function node_build_filter_query() { list($key, $value) = explode('-', $value, 2); $where[] = 'n.' . $key . ' = %d'; break; - case 'category': + case 'term': $table = "tn$index"; $where[] = "$table.tid = %d"; $join .= "INNER JOIN {term_node} $table ON n.nid = $table.nid "; @@ -219,7 +219,7 @@ function node_filter_form() { $form['#submit'][] = 'node_filter_form_submit'; foreach ($session as $filter) { list($type, $value) = $filter; - if ($type == 'category') { + if ($type == 'term') { // Load term name from DB rather than search and parse options array. $value = module_invoke('taxonomy', 'get_term', $value); $value = $value->name; Index: modules/node/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.module,v retrieving revision 1.974 diff -u -p -r1.974 node.module --- modules/node/node.module 6 Sep 2008 08:36:20 -0000 1.974 +++ modules/node/node.module 8 Sep 2008 21:50:25 -0000 @@ -1269,24 +1269,24 @@ function node_search($op = 'search', $ke $keys = search_query_insert($keys, 'type'); } - if ($category = search_query_extract($keys, 'category')) { - $categories = array(); - foreach (explode(',', $category) as $c) { - $categories[] = "tn.tid = %d"; + if ($term = search_query_extract($keys, 'term')) { + $terms = array(); + foreach (explode(',', $term) as $c) { + $terms[] = "tn.tid = %d"; $arguments1[] = $c; } - $conditions1 .= ' AND (' . implode(' OR ', $categories) . ')'; + $conditions1 .= ' AND (' . implode(' OR ', $terms) . ')'; $join1 .= ' INNER JOIN {term_node} tn ON n.vid = tn.vid'; - $keys = search_query_insert($keys, 'category'); + $keys = search_query_insert($keys, 'term'); } if ($languages = search_query_extract($keys, 'language')) { - $categories = array(); + $terms = array(); foreach (explode(',', $languages) as $l) { - $categories[] = "n.language = '%s'"; + $terms[] = "n.language = '%s'"; $arguments1[] = $l; } - $conditions1 .= ' AND (' . implode(' OR ', $categories) . ')'; + $conditions1 .= ' AND (' . implode(' OR ', $terms) . ')'; $keys = search_query_insert($keys, 'language'); } @@ -1918,9 +1918,9 @@ function node_form_alter(&$form, $form_s // Taxonomy box: if ($taxonomy = module_invoke('taxonomy', 'form_all', 1)) { - $form['advanced']['category'] = array( + $form['advanced']['term'] = array( '#type' => 'select', - '#title' => t('Only in the category(s)'), + '#title' => t('Only in the term(s)'), '#prefix' => '
', '#size' => 10, '#suffix' => '
', @@ -1981,8 +1981,8 @@ function node_search_validate($form, &$f } } - if (isset($form_state['values']['category']) && is_array($form_state['values']['category'])) { - $keys = search_query_insert($keys, 'category', implode(',', $form_state['values']['category'])); + if (isset($form_state['values']['term']) && is_array($form_state['values']['term'])) { + $keys = search_query_insert($keys, 'term', implode(',', $form_state['values']['term'])); } if (isset($form_state['values']['language']) && is_array($form_state['values']['language'])) { $keys = search_query_insert($keys, 'language', implode(',', array_filter($form_state['values']['language']))); Index: modules/taxonomy/taxonomy.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.admin.inc,v retrieving revision 1.27 diff -u -p -r1.27 taxonomy.admin.inc --- modules/taxonomy/taxonomy.admin.inc 16 Jul 2008 21:59:28 -0000 1.27 +++ modules/taxonomy/taxonomy.admin.inc 8 Sep 2008 21:50:25 -0000 @@ -286,7 +286,7 @@ function taxonomy_overview_terms(&$form_ // We are not calling taxonomy_get_tree because that might fail with a big // number of tags in the freetagging vocabulary. $results = pager_query(db_rewrite_sql('SELECT t.*, h.parent FROM {term_data} t INNER JOIN {term_hierarchy} h ON t.tid = h.tid WHERE t.vid = %d ORDER BY weight, name', 't', 'tid'), $page_increment, 0, NULL, $vocabulary->vid); - $total_entries = db_query(db_rewrite_sql('SELECT count(*) FROM {term_data} t INNER JOIN {term_hierarchy} h ON t.tid = h.tid WHERE t.vid = %d'), $page_increment, 0, NULL, $vocabulary->vid); + $total_entries = db_query(db_rewrite_sql('SELECT count(*) FROM {term_data} t INNER JOIN {term_hierarchy} h ON t.tid = h.tid WHERE t.vid = :vid'), array(':vid' => $vocabulary->vid)); while ($term = db_fetch_object($results)) { $key = 'tid:' . $term->tid . ':0'; $current_page[$key] = $term; @@ -928,7 +928,7 @@ function taxonomy_vocabulary_confirm_res * @see taxonomy_vocabulary_confirm_reset_alphabetical() */ function taxonomy_vocabulary_confirm_reset_alphabetical_submit($form, &$form_state) { - db_query('UPDATE {term_data} t SET weight = 0 WHERE vid = %d', $form_state['values']['vid']); + db_query('UPDATE {term_data} t SET weight = 0 WHERE vid = :vid', array(':vid' => $form_state['values']['vid'])); drupal_set_message(t('Reset vocabulary %name to alphabetical order.', array('%name' => $form_state['values']['name']))); watchdog('taxonomy', 'Reset vocabulary %name to alphabetical order.', array('%name' => $form_state['values']['name']), WATCHDOG_NOTICE); $form_state['redirect'] = 'admin/content/taxonomy/' . $form_state['values']['vid']; Index: modules/taxonomy/taxonomy.test =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.test,v retrieving revision 1.3 diff -u -p -r1.3 taxonomy.test --- modules/taxonomy/taxonomy.test 8 Sep 2008 21:37:21 -0000 1.3 +++ modules/taxonomy/taxonomy.test 8 Sep 2008 21:50:25 -0000 @@ -284,6 +284,44 @@ class TaxonomyTermMultipleTestCase exten } +class TaxonomyAdminTestCase extends DrupalWebTestCase { + /** + * Implementation of getInfo(). + */ + function getInfo() { + return array( + 'name' => t('Administration interface'), + 'description' => t('Test the vocabulary administration interface.'), + 'group' => t('Taxonomy'), + ); + } + + /** + * Implementation of setUp(). + */ + function setUp() { + parent::setUp(); + $this->taxonomy_admin = $this->drupalCreateUser(array('administer taxonomy')); + } + + /** + * Visit the various admin pages for the default 'Tags' vocabulary. + */ + function testTaxonomyAdminPages() { + $this->drupalLogin($this->taxonomy_admin); + $this->drupalGet('admin/content/taxonomy'); + $this->assertResponse('200'); + $this->assertText(t('Article'), t('Article vocabulary found.')); + $this->clickLink(t('edit vocabulary')); + $this->assertResponse('200'); + $this->drupalGet('admin/content/taxonomy'); + $this->clickLink(t('list terms')); + $this->assertResponse('200'); + $this->clickLink(t('Add term')); + $this->assertResponse('200'); + } +} + class TaxonomyTestNodeApiTestCase extends DrupalWebTestCase { /** * Implementation of getInfo(). @@ -292,7 +330,7 @@ class TaxonomyTestNodeApiTestCase extend return array( 'name' => t('Taxonomy nodeapi'), 'description' => t('Save & edit a node and assert that taxonomy terms are saved/loaded properly.'), - 'group' => t('Taxonomy') + 'group' => t('Taxonomy'), ); }