JMAConsulting / biz.jmaconsulting.mte

Mandrill Emails Extension for CiviCRM
10 stars 21 forks source link

DB Error: no such field under CiviCRM 4.7.21 #111

Open crusonweb opened 7 years ago

crusonweb commented 7 years ago

I have run into an issue under CiviCRM 4.7.21 where the Mail Opened Report returns DB Error: no such field. The problem appears to me to be connected to line 495 in mte.php. That line adds

count(DISTINCT(civicrm_mailing_event_opened.id)) as opened_count

to the query. However in the full query for that report civicrm_mailing_event_opened.id gets assigned to civicrm_mailing_event_opened_id, so the line actually needs to read

count(DISTINCT(civicrm_mailing_event_opened_id)) as opened_count

I tested this doing the query directly on the database and it works and adjusting the mte.php code file fixes the error. However, am I missing a better fix?