diff --git a/modules/contact/contact.admin.inc b/modules/contact/contact.admin.inc index 6d643c21e5a8c42700d11328b34e45e8243fdd17..a212db52bef4cca32a583cf00b280a07ada7a362 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 d3ef4ce7d8ce1c500ac0be3501db770f7cf86e16..2bbf816bfa8d734607e236bcddd12819b9d6336c 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(); } /**