Skip to content

Commit

Permalink
Merge pull request #14760 from eileenmcnaughton/unsub
Browse files Browse the repository at this point in the history
dev/core#1108 [REF] use CRM_Core_DAO::executeQuery instead of ->query()
  • Loading branch information
seamuslee001 authored Jul 28, 2019
2 parents e0c683a + f704aa3 commit dd1ed5f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions CRM/Mailing/Event/BAO/Unsubscribe.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,10 @@ public static function &unsub_from_mailing($job_id, $queue_id, $hash, $return =
// 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'");

Expand Down Expand Up @@ -255,12 +255,12 @@ public static function &unsub_from_mailing($job_id, $queue_id, $hash, $return =
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
Expand Down

0 comments on commit dd1ed5f

Please sign in to comment.