I have the taxonomy_browser installed on two sites. One site, I can select multiple terms for the taxonomy display. On the other, only one. It appears that the pull down menu for the taxonomy_browser display does not allow multiple selects of vocabulary items unless the vocabulary has multiple select set in the vocabulary configuration.

Comments

levin-1’s picture

Component: User interface » Code

here's my fix to this problem:

in the taxonomy_brower.module add this function:

// this is basically a copy of taxonomy_form from the taxonomy module
// but cut so that the browser always lets you make multiple selections
// and offers a default blank. 
function taxonomy_browser_form($vocabulary_id, $value = 0, $error = array()) {
  $vocabulary = taxonomy_get_vocabulary($vocabulary_id);
  $descriptions = array(t("Select the terms for your search."), t("Select the te
rms for your search."));
  $blank = "<". t("none") .">";

  // always treat as multiple
  $multiple = intval(1);

  $description = $descriptions[$multiple] . $error['taxonomy'];

  return _taxonomy_term_select($vocabulary->name, 'taxonomy', $value, $vocabular
y_id, $description, $multiple, $blank);
}

and then replace this line:

$output .= taxonomy_form($voc);

from function taxonomy_browser_overview() with this:

$output .= taxonomy_browser_form($voc);

and while you're at it you may as well add to function taxonomy_browser_nodes($edit)
this 'if' so if there is no selections this implode doesn't give an error

  if( count($tids) ) {
    $taxonomy->str_tids = check_query(implode(",", $taxonomy->tids));
  }

should i be posting this somewhere else? cheers
levin

matt westgate’s picture

This has been fixed for Drupal 4.5 and up.