diff --git a/references_dialog.dialog_widgets.inc b/references_dialog.dialog_widgets.inc index 34f1d87..a132881 100644 --- a/references_dialog.dialog_widgets.inc +++ b/references_dialog.dialog_widgets.inc @@ -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); } diff --git a/references_dialog.module b/references_dialog.module index f76ad65..771bdf2 100644 --- a/references_dialog.module +++ b/references_dialog.module @@ -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); } }