summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-08-22 13:53:37 +0000
committerDries Buytaert <dries@buytaert.net>2010-08-22 13:53:37 +0000
commit39d6704418f4a072f7157a524d4742a6c4e4f593 (patch)
tree0a11670f2426cd2c2d533fb0306b462f2f5f3cd4 /modules
parent4a7bb638fb3243a35dd2ce82a4cafc78d2f6b9d2 (diff)
downloadbrdo-39d6704418f4a072f7157a524d4742a6c4e4f593.tar.gz
brdo-39d6704418f4a072f7157a524d4742a6c4e4f593.tar.bz2
- Patch #796692 by cross, dman, aaronbauman, BarisW: only show the term heading if the term has a description.
Diffstat (limited to 'modules')
-rw-r--r--modules/taxonomy/taxonomy.pages.inc14
-rw-r--r--modules/taxonomy/taxonomy.test8
2 files changed, 17 insertions, 5 deletions
diff --git a/modules/taxonomy/taxonomy.pages.inc b/modules/taxonomy/taxonomy.pages.inc
index e4a6fad76..1af17db7e 100644
--- a/modules/taxonomy/taxonomy.pages.inc
+++ b/modules/taxonomy/taxonomy.pages.inc
@@ -29,11 +29,15 @@ function taxonomy_term_page($term) {
drupal_set_breadcrumb($breadcrumb);
drupal_add_feed('taxonomy/term/' . $term->tid . '/feed', 'RSS - ' . $term->name);
- $build['term_heading'] = array(
- '#prefix' => '<div class="term-listing-heading">',
- '#suffix' => '</div>',
- 'term' => taxonomy_term_view($term, 'full'),
- );
+ $build = array();
+ // Add term heading if the term has a description
+ if (!empty($term->description)) {
+ $build['term_heading'] = array(
+ '#prefix' => '<div class="term-listing-heading">',
+ '#suffix' => '</div>',
+ 'term' => taxonomy_term_view($term, 'full'),
+ );
+ }
if ($nids = taxonomy_select_nodes($term->tid, TRUE, variable_get('default_nodes_main', 10))) {
$nodes = node_load_multiple($nids);
diff --git a/modules/taxonomy/taxonomy.test b/modules/taxonomy/taxonomy.test
index 87cfb4011..af50e5346 100644
--- a/modules/taxonomy/taxonomy.test
+++ b/modules/taxonomy/taxonomy.test
@@ -566,6 +566,14 @@ class TaxonomyTermTestCase extends TaxonomyWebTestCase {
$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="term-listing-heading"|', '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="term-listing-heading"|', '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');