diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-04-13 18:52:38 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-04-13 18:52:38 +0000 |
commit | 31dbee5459b706738273d20d8315c31e0a6f6336 (patch) | |
tree | 82681586fd3b0e0ea88a730427d26075be69980f /modules | |
parent | d79481b3a093fad333ff0e32912133412ce129de (diff) | |
download | brdo-31dbee5459b706738273d20d8315c31e0a6f6336.tar.gz brdo-31dbee5459b706738273d20d8315c31e0a6f6336.tar.bz2 |
- Patch #432154 by Berdir: fixed bug in taxonomy_vocabulary_load_multiple. With tests.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/taxonomy/taxonomy.module | 2 | ||||
-rw-r--r-- | modules/taxonomy/taxonomy.test | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 5215c6cc4..56c207895 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -1019,7 +1019,7 @@ function taxonomy_vocabulary_load_multiple($vids = array(), $conditions = array( $query->orderBy('v.name'); if (!empty($type)) { - $query->leftJoin('taxonomy_vocabulary_node_type', 'n', 'v.vid = n.vid WHERE n.type = :type', array(':type' => $type)); + $query->leftJoin('taxonomy_vocabulary_node_type', 'n', 'v.vid = n.vid AND n.type = :type', array(':type' => $type)); } else { $query->leftJoin('taxonomy_vocabulary_node_type', 'n', 'v.vid = n.vid'); diff --git a/modules/taxonomy/taxonomy.test b/modules/taxonomy/taxonomy.test index fda432120..636c7a030 100644 --- a/modules/taxonomy/taxonomy.test +++ b/modules/taxonomy/taxonomy.test @@ -276,6 +276,11 @@ public static function getInfo() { // Fetch vocabulary 1 by name and ID. $this->assertTrue(current(taxonomy_vocabulary_load_multiple(array($vocabulary1->vid), array('name' => $vocabulary1->name))) == $vocabulary1, t('Vocabulary loaded successfully by name and ID.')); + + // Fetch vocabulary 1 with specified node type. + drupal_static_reset('taxonomy_vocabulary_load_multiple'); + $vocabulary_node_type = current(taxonomy_vocabulary_load_multiple(array($vocabulary1->vid), array('type' => 'article'))); + $this->assertEqual($vocabulary_node_type, $vocabulary1, t('Vocabulary with specified node type loaded successfully.')); } } |