commit 86b53f0d7abf802d584dc7e8e22ce49651c62870 Author: Alexandr Kirienko Date: Sun May 10 23:18:22 2015 +0600 #2463541-3 diff --git a/synonyms.module b/synonyms.module index 58d30bd..a80ab57 100644 --- a/synonyms.module +++ b/synonyms.module @@ -361,14 +361,14 @@ function synonyms_get_term_by_synonym($name, $vocabulary, $parent = 0) { $result = $query->execute(); - $term = reset($result['taxonomy_term']); + if (isset($result['taxonomy_term'])) { + $term = reset($result['taxonomy_term']); - if (isset($term->tid)) { return $term->tid; } } - if ($term = taxonomy_get_term_by_name($name, $vocabulary)) { + if ($term = taxonomy_get_term_by_name($name, $vocabulary->machine_name)) { return $term->tid; }