From f80b75d14d4f9aa92ef439c093a0d7fe201339f3 Mon Sep 17 00:00:00 2001 From: solotandem Date: Fri, 13 Jan 2012 16:15:35 -0600 Subject: [PATCH] #965450: Automatically add the terms as a result of adding the vocabulary. --- includes/uuid_vocabulary.features.inc | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/includes/uuid_vocabulary.features.inc b/includes/uuid_vocabulary.features.inc index 9cad8be..280b3ab 100644 --- a/includes/uuid_vocabulary.features.inc +++ b/includes/uuid_vocabulary.features.inc @@ -33,6 +33,20 @@ function uuid_vocabulary_features_export($data, &$export, $module_name = '') { foreach ($data as $uuid) { $export['features']['uuid_vocabulary'][$uuid] = $uuid; + // Create a pipe for the terms in the vocabulary. + $vid = uuid_get_serial_id('vocabulary', 'vid', $uuid); + $terms = taxonomy_get_tree($vid); + $query = 'SELECT t.tid, t.name, v.name AS vname, ut.uuid + FROM {term_data} t + INNER JOIN {uuid_term_data} ut ON t.tid = ut.tid + INNER JOIN {vocabulary} v ON t.vid = v.vid + INNER JOIN {uuid_vocabulary} uv ON v.vid = uv.vid + WHERE uv.uuid = "%s" + ORDER BY v.name ASC, t.name ASC'; + $result = db_query($query, $uuid); + while ($term = db_fetch_object($result)) { + $pipe['uuid_term'][$term->uuid] = $term->uuid; + } } return $pipe; -- 1.7.7