dev/core#1108 [REF] use CRM_Core_DAO::executeQuery instead of ->query()
authoreileen <emcnaughton@wikimedia.org>
Tue, 9 Jul 2019 06:30:39 +0000 (18:30 +1200)
committereileen <emcnaughton@wikimedia.org>
Tue, 9 Jul 2019 06:31:36 +0000 (18:31 +1200)
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

index f6c4771e28f569ec648047e35af2fa5d1e654a9d..55ca19c0d34cafa6b3a48d7633da88f156dd4e08 100644 (file)
@@ -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