twomice / com.joineryhq.jsumfields

Provides additional fields under the Summary Fields framework.
Other
1 stars 10 forks source link

jsumfields civicrm_mailing_event_bounce_after_insert db trigger prevents bounces from being recorded #16

Open mmyriam opened 3 years ago

mmyriam commented 3 years ago

cc @mlutfy

[debug_info] => INSERT INTO `civicrm_mailing_event_bounce` (`event_queue_id` , `bounce_type_id` , `bounce_reason` , `time_stamp` ) VALUES ( 51372 ,  6 , '550 5.5.0 Requested action not taken: mailbox unavailable (S{hex}). [MW2NAM12FT059.eop-nam12.prod.protection.outlook.com]' ,  20201120103205 )  [nativecode=1054 ** Unknown column 'j.start_date' in 'where clause']
                  -- total mailings sent to contact
                  SELECT q2.contact_id, count(*) as sent
                  FROM
                    civicrm_mailing_event_queue q1
                    INNER JOIN civicrm_mailing_event_queue q2 ON q1.contact_id = q2.contact_id
                    INNER JOIN civicrm_mailing_event_delivered d ON d.event_queue_id = q2.id
                  WHERE
                    q1.id = NEW.event_queue_id
                    AND j.start_date >= DATE_SUB(CURDATE(), INTERVAL 1 YEAR)
                  GROUP BY
                    q2.contact_id

Dropping the trigger (and configuring summary data to be updated by cron job) does not solve the problem as the trigger is recreated even if sumfields config page is not saved.

twomice commented 3 years ago

Thanks for the report @mmyriam To be clear about the severity of this issue: does this problem still appear when the "Open rate rate last 12 months" summary field is disabled?

mmyriam commented 3 years ago

@twomice Thank you for looking into this.

The problem appears when the trigger is present - and the trigger is recreated when the config page is saved even if "Open rate rate last 12 months" and "Open rate rate all time" are disabled.

Note that those 2 fields are the reason for activating this extension so disabling them is not the solution in my case.

twomice commented 6 months ago

Possibly related to #25. (See especially the discussion at https://github.com/twomice/com.joineryhq.jsumfields/issues/25#issuecomment-2005150863 and following).

Closing as this ticket is very old. I'm sorry I could not help you with this. In #25 (comment), I mention I've created an issue for this in the sumfields project.