summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/taxonomy/taxonomy.module2
-rw-r--r--modules/taxonomy/taxonomy.test7
2 files changed, 8 insertions, 1 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index 53963fd10..2658eb430 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -1103,7 +1103,7 @@ function taxonomy_term_load_multiple($tids = array(), $conditions = array(), $re
// If the conditions array is populated, add those to the query.
if ($conditions) {
foreach ($conditions as $field => $value) {
- $query->conditions('t.' . $field, $value);
+ $query->condition('t.' . $field, $value);
}
}
$queried_terms = $query->execute()->fetchAllAssoc('tid');
diff --git a/modules/taxonomy/taxonomy.test b/modules/taxonomy/taxonomy.test
index 9f36b680e..531d94812 100644
--- a/modules/taxonomy/taxonomy.test
+++ b/modules/taxonomy/taxonomy.test
@@ -491,5 +491,12 @@ class TaxonomyLoadMultipleUnitTest extends TaxonomyWebTestCase {
$terms4 = taxonomy_term_load_multiple(NULL, array('vid' => $vocabulary->vid), TRUE);
$this->assertTrue(count($terms4 == 4), t('Correct number of terms were loaded.'));
$this->assertFalse(isset($terms4[$deleted->tid]));
+
+ // Create a single term and load it by name.
+ $term = $this->createTerm($vocabulary->vid);
+ $loaded_terms = taxonomy_term_load_multiple(array(), array('name' => $term->name));
+ $this->assertEqual(count($loaded_terms), 1, t('One term was loaded'));
+ $loaded_term = reset($loaded_terms);
+ $this->assertEqual($term->tid, $loaded_term->tid, t('Term loaded by name successfully.'));
}
}