Skip to content

Commit

Permalink
fixes #21
Browse files Browse the repository at this point in the history
  • Loading branch information
robertgarrigos committed Aug 18, 2024
1 parent 72d4f8b commit 7baac08
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions references_dialog.dialog_widgets.inc
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,6 @@ function references_dialog_term_reference_views_query($view, $instance, $field)
// We need to make sure that no entries that we can't add to our field shows
// up, so we need to limit the data here.
$vocabulary = taxonomy_vocabulary_load($field['settings']['allowed_values'][0]['vocabulary']);
$types = array($vocabulary->vid);
$view->query->add_where(0, "$view->base_table.vid", $types);
$types = array($vocabulary->machine_name);
$view->query->add_where(0, "$view->base_table.vocabulary", $types);
}
4 changes: 2 additions & 2 deletions references_dialog.module
Original file line number Diff line number Diff line change
Expand Up @@ -819,10 +819,10 @@ function references_dialog_term_reference_autocomplete_validate($element, &$form
$vocabularies = array();
foreach ($field['settings']['allowed_values'] as $tree) {
if ($vocabulary = taxonomy_vocabulary_load($tree['vocabulary'])) {
$vocabularies[$vocabulary->vid] = $vocabulary;
$vocabularies[$vocabulary->machine_name] = $vocabulary->machine_name;
}
}
if ($possibilities = taxonomy_term_load_multiple(array(), array('name' => trim($element['#value']), 'vid' => array_keys($vocabularies)))) {
if ($possibilities = taxonomy_term_load_multiple(array(), array('name' => trim($element['#value']), 'vocabulary' => array_keys($vocabularies)))) {
$term = array_pop($possibilities);
}
}
Expand Down

0 comments on commit 7baac08

Please sign in to comment.