diff --git a/plugins/arguments/term.inc b/plugins/arguments/term.inc index 65c87ac..172812f 100644 --- a/plugins/arguments/term.inc +++ b/plugins/arguments/term.inc @@ -56,11 +56,15 @@ function ctools_term_context($arg = NULL, $conf = NULL, $empty = FALSE) { break; case 'term': - if (!empty($conf['transform'])) { + // First try to load terms with the original argument. + $terms = taxonomy_get_term_by_name($arg); + // If no terms could be loaded and dashes should be transformed then we + // try again with that. + if (!empty($conf['transform']) && empty($terms)) { $arg = strtr($arg, '-', ' '); + $terms = taxonomy_get_term_by_name($arg); } - $terms = taxonomy_get_term_by_name($arg); // If only one term is found, fall through to vocabulary check below. if ((count($terms) > 1) && $vocabularies) { foreach ($terms as $potential) {