diff --git a/modules/taxonomy.module b/modules/taxonomy.module index 819194da4d0f..0b20db1e49f1 100644 --- a/modules/taxonomy.module +++ b/modules/taxonomy.module @@ -855,44 +855,45 @@ function taxonomy_term_page($str_tids = '', $depth = 0, $op = 'page') { drupal_not_found(); } - // Build title: - $result = db_query('SELECT name FROM {term_data} WHERE tid IN (%s)', implode(',', $tids)); - $names = array(); - while ($term = db_fetch_object($result)) { - $names[] = $term->name; - } - $title = implode(', ', $names); + if ($tids) { + // Build title: + $result = db_query('SELECT name FROM {term_data} WHERE tid IN (%s)', implode(',', $tids)); + $names = array(); + while ($term = db_fetch_object($result)) { + $names[] = $term->name; + } + $title = implode(', ', $names); - switch ($op) { - case 'page': - // Build breadcrumb based on first hierarchy of first term: - $current->tid = $tids[0]; - $breadcrumbs = array(array('path' => $_GET['q'])); - while ($parents = taxonomy_get_parents($current->tid)) { - $current = array_shift($parents); - $breadcrumbs[] = array('path' => 'taxonomy/term/'. $current->tid, 'title' => $current->name); - } - $breadcrumbs = array_reverse($breadcrumbs); - menu_set_location($breadcrumbs); + switch ($op) { + case 'page': + // Build breadcrumb based on first hierarchy of first term: + $current->tid = $tids[0]; + $breadcrumbs = array(array('path' => $_GET['q'])); + while ($parents = taxonomy_get_parents($current->tid)) { + $current = array_shift($parents); + $breadcrumbs[] = array('path' => 'taxonomy/term/'. $current->tid, 'title' => $current->name); + } + $breadcrumbs = array_reverse($breadcrumbs); + menu_set_location($breadcrumbs); - drupal_set_html_head(''); + drupal_set_html_head(''); - $output = taxonomy_render_nodes(taxonomy_select_nodes($tids, $operator, $depth, TRUE)); - print theme('page', $output, $title); - break; + $output = taxonomy_render_nodes(taxonomy_select_nodes($tids, $operator, $depth, TRUE)); + print theme('page', $output, $title); + break; - case 'feed': - $term = taxonomy_get_term($tids[0]); - $channel['link'] = url('taxonomy/term/'. $str_tids .'/'. $depth, NULL, NULL, TRUE); - $channel['title'] = variable_get('site_name', 'drupal') .' - '. $title; - $channel['description'] = $term->description; + case 'feed': + $term = taxonomy_get_term($tids[0]); + $channel['link'] = url('taxonomy/term/'. $str_tids .'/'. $depth, NULL, NULL, TRUE); + $channel['title'] = variable_get('site_name', 'drupal') .' - '. $title; + $channel['description'] = $term->description; - $result = taxonomy_select_nodes($tids, $operator, $depth, FALSE); - node_feed($result, $channel); - break; - - default: - drupal_not_found(); + $result = taxonomy_select_nodes($tids, $operator, $depth, FALSE); + node_feed($result, $channel); + break; + default: + drupal_not_found(); + } } } diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 819194da4d0f..0b20db1e49f1 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -855,44 +855,45 @@ function taxonomy_term_page($str_tids = '', $depth = 0, $op = 'page') { drupal_not_found(); } - // Build title: - $result = db_query('SELECT name FROM {term_data} WHERE tid IN (%s)', implode(',', $tids)); - $names = array(); - while ($term = db_fetch_object($result)) { - $names[] = $term->name; - } - $title = implode(', ', $names); + if ($tids) { + // Build title: + $result = db_query('SELECT name FROM {term_data} WHERE tid IN (%s)', implode(',', $tids)); + $names = array(); + while ($term = db_fetch_object($result)) { + $names[] = $term->name; + } + $title = implode(', ', $names); - switch ($op) { - case 'page': - // Build breadcrumb based on first hierarchy of first term: - $current->tid = $tids[0]; - $breadcrumbs = array(array('path' => $_GET['q'])); - while ($parents = taxonomy_get_parents($current->tid)) { - $current = array_shift($parents); - $breadcrumbs[] = array('path' => 'taxonomy/term/'. $current->tid, 'title' => $current->name); - } - $breadcrumbs = array_reverse($breadcrumbs); - menu_set_location($breadcrumbs); + switch ($op) { + case 'page': + // Build breadcrumb based on first hierarchy of first term: + $current->tid = $tids[0]; + $breadcrumbs = array(array('path' => $_GET['q'])); + while ($parents = taxonomy_get_parents($current->tid)) { + $current = array_shift($parents); + $breadcrumbs[] = array('path' => 'taxonomy/term/'. $current->tid, 'title' => $current->name); + } + $breadcrumbs = array_reverse($breadcrumbs); + menu_set_location($breadcrumbs); - drupal_set_html_head(''); + drupal_set_html_head(''); - $output = taxonomy_render_nodes(taxonomy_select_nodes($tids, $operator, $depth, TRUE)); - print theme('page', $output, $title); - break; + $output = taxonomy_render_nodes(taxonomy_select_nodes($tids, $operator, $depth, TRUE)); + print theme('page', $output, $title); + break; - case 'feed': - $term = taxonomy_get_term($tids[0]); - $channel['link'] = url('taxonomy/term/'. $str_tids .'/'. $depth, NULL, NULL, TRUE); - $channel['title'] = variable_get('site_name', 'drupal') .' - '. $title; - $channel['description'] = $term->description; + case 'feed': + $term = taxonomy_get_term($tids[0]); + $channel['link'] = url('taxonomy/term/'. $str_tids .'/'. $depth, NULL, NULL, TRUE); + $channel['title'] = variable_get('site_name', 'drupal') .' - '. $title; + $channel['description'] = $term->description; - $result = taxonomy_select_nodes($tids, $operator, $depth, FALSE); - node_feed($result, $channel); - break; - - default: - drupal_not_found(); + $result = taxonomy_select_nodes($tids, $operator, $depth, FALSE); + node_feed($result, $channel); + break; + default: + drupal_not_found(); + } } }