Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.603
diff -u -p -r1.603 taxonomy.module
--- modules/taxonomy/taxonomy.module 22 Aug 2010 15:45:03 -0000 1.603
+++ modules/taxonomy/taxonomy.module 22 Aug 2010 23:25:47 -0000
@@ -606,23 +606,27 @@ function taxonomy_term_view($term, $view
field_attach_prepare_view('taxonomy_term', array($term->tid => $term), $view_mode);
entity_prepare_view('taxonomy_term', array($term->tid => $term));
- $build = array(
- '#theme' => 'taxonomy_term',
- '#term' => $term,
- '#view_mode' => $view_mode,
- );
-
+ $build = array();
+
+ if (!empty($term->description)) {
+ $build['description'] = array(
+ '#markup' => check_markup($term->description, $term->format, '', TRUE),
+ '#weight' => 0,
+ '#prefix' => '
',
+ '#suffix' => '
',
+ );
+ }
$build += field_attach_view('taxonomy_term', $term, $view_mode);
-
- $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';
-
+
+ if (! empty($build)) {
+ // Only return markup if there is content to be rendered.
+ $build = array(
+ '#theme' => 'taxonomy_term',
+ '#term' => $term,
+ '#view_mode' => $view_mode,
+ );
+ $build['#attached']['css'][] = drupal_get_path('module', 'taxonomy') . '/taxonomy.css';
+ }
return $build;
}
Index: modules/taxonomy/taxonomy.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.pages.inc,v
retrieving revision 1.53
diff -u -p -r1.53 taxonomy.pages.inc
--- modules/taxonomy/taxonomy.pages.inc 22 Aug 2010 13:53:37 -0000 1.53
+++ modules/taxonomy/taxonomy.pages.inc 22 Aug 2010 23:25:47 -0000
@@ -30,12 +30,13 @@ function taxonomy_term_page($term) {
drupal_add_feed('taxonomy/term/' . $term->tid . '/feed', 'RSS - ' . $term->name);
$build = array();
- // Add term heading if the term has a description
- if (!empty($term->description)) {
+ // Add term heading only if there is some content to show.
+ $term_view = taxonomy_term_view($term, 'full');
+ if (!empty($term_view)) {
$build['term_heading'] = array(
'#prefix' => '',
'#suffix' => '
',
- 'term' => taxonomy_term_view($term, 'full'),
+ 'term' => $term_view,
);
}