summaryrefslogtreecommitdiff
path: root/modules/contact
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-02-26 18:35:35 +0000
committerDries Buytaert <dries@buytaert.net>2010-02-26 18:35:35 +0000
commitbbbe8c178c4ea336c4d14b6eadcff822f5d8330c (patch)
tree99fdda5c0ad64d8f8949c9d651bec984e82b6c08 /modules/contact
parentf6b166ff23faa3ab8a2f643394842710dbecfd3d (diff)
downloadbrdo-bbbe8c178c4ea336c4d14b6eadcff822f5d8330c.tar.gz
brdo-bbbe8c178c4ea336c4d14b6eadcff822f5d8330c.tar.bz2
- Patch #251482 by andypost, Dave Reid, hunvreus: contact categories can't be translated with i18n.
Diffstat (limited to 'modules/contact')
-rw-r--r--modules/contact/contact.admin.inc8
-rw-r--r--modules/contact/contact.module7
2 files changed, 13 insertions, 2 deletions
diff --git a/modules/contact/contact.admin.inc b/modules/contact/contact.admin.inc
index 6d643c21e..a212db52b 100644
--- a/modules/contact/contact.admin.inc
+++ b/modules/contact/contact.admin.inc
@@ -19,7 +19,13 @@ function contact_category_list() {
$rows = array();
// Get all the contact categories from the database.
- $categories = db_query('SELECT cid, category, recipients, selected FROM {contact} ORDER BY weight, category')->fetchAll();
+ $categories = db_select('contact', 'c')
+ ->addTag('translatable')
+ ->fields('c', array('cid', 'category', 'recipients', 'selected'))
+ ->orderBy('weight')
+ ->orderBy('category')
+ ->execute()
+ ->fetchAll();
// Loop through the categories and add them to the table.
foreach ($categories as $category) {
diff --git a/modules/contact/contact.module b/modules/contact/contact.module
index d3ef4ce7d..2bbf816bf 100644
--- a/modules/contact/contact.module
+++ b/modules/contact/contact.module
@@ -159,7 +159,12 @@ function _contact_personal_tab_access(stdClass $account) {
* An array with the contact category's data.
*/
function contact_load($cid) {
- return db_query("SELECT * FROM {contact} WHERE cid = :cid", array(':cid' => $cid))->fetchAssoc();
+ return db_select('contact', 'c')
+ ->addTag('translatable')
+ ->fields('c')
+ ->condition('cid', $cid)
+ ->execute()
+ ->fetchAssoc();
}
/**