From f704aa301b8b7f22f55a778cbc5555b5849a4f89 Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 9 Jul 2019 18:30:39 +1200 Subject: [PATCH] dev/core#1108 [REF] use CRM_Core_DAO::executeQuery instead of ->query() This allows us to leave the multilingual translation to the I18n rewriter. This PR just removes 2 instances from this function. Once the others are removed we should be able to remove the swath of code defining I18n tables are the start of the function and simplify the tables involved Note testUnsubscribeGroupList passes through this code --- CRM/Mailing/Event/BAO/Unsubscribe.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CRM/Mailing/Event/BAO/Unsubscribe.php b/CRM/Mailing/Event/BAO/Unsubscribe.php index f6c4771e28..55ca19c0d3 100644 --- a/CRM/Mailing/Event/BAO/Unsubscribe.php +++ b/CRM/Mailing/Event/BAO/Unsubscribe.php @@ -220,10 +220,10 @@ WHERE email = %2 // list. while (!empty($mailings)) { - $do->query(" + $do = CRM_Core_DAO::executeQuery(" SELECT $mg.entity_table as entity_table, $mg.entity_id as entity_id - FROM $mg + FROM civicrm_mailing_group $mg WHERE $mg.mailing_id IN (" . implode(', ', $mailings) . ") AND $mg.group_type = 'Include'"); @@ -258,12 +258,12 @@ WHERE email = %2 if ($groupIds || $baseGroupIds) { $groupIdClause = "AND $group.id IN (" . implode(', ', array_merge($groupIds, $baseGroupIds)) . ")"; } - $do->query(" + $do = CRM_Core_DAO::executeQuery(" SELECT $group.id as group_id, $group.title as title, $group.description as description - FROM $group - LEFT JOIN $gc + FROM civicrm_group $group + LEFT JOIN civicrm_group_contact $gc ON $gc.group_id = $group.id WHERE $group.is_hidden = 0 $groupIdClause -- 2.25.1