civicrm / org.civicrm.doctorwhen

Doctor When: Temporal cleanup agent
Other
2 stars 9 forks source link

CiviMail is broken after running DoctorWhen #7

Closed adanielvv closed 6 years ago

adanielvv commented 6 years ago

Excerpt from show create table civicrm_mailing_job; before and after running DoctorWhen: Before:

`scheduled_date` datetime DEFAULT NULL COMMENT 'date on which this job was scheduled.',
`start_date` datetime DEFAULT NULL COMMENT 'date on which this job was started.',
`end_date` datetime DEFAULT NULL COMMENT 'date on which this job ended.',

After:

`scheduled_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`start_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`end_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',

Locations where CiviMail expects NULL instead of 0: https://github.com/civicrm/civicrm-core/compare/master...DanielvV:fix_date_check

adanielvv commented 6 years ago

Running DoctorWhen after merging PR #6

  `scheduled_date` timestamp NULL DEFAULT NULL,
  `start_date` timestamp NULL DEFAULT NULL,
  `end_date` timestamp NULL DEFAULT NULL,

Nicer if it would be this?

  `scheduled_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `start_date` timestamp NULL DEFAULT NULL,
  `end_date` timestamp NULL DEFAULT NULL,
adanielvv commented 6 years ago

Or this?

  `scheduled_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
adanielvv commented 6 years ago
  `scheduled_date` timestamp NULL DEFAULT NULL,

is correct as per civicrm-core xml/schema/Mailing/MailingJob.xml#L32-L39 and CRM/Utils/Check/Component/Timestamps.php#L129

dptarrant commented 6 years ago

My test this AM with updated version seems to have the problems. (I believe it is the new version based on dates on files changed on 11/13 although the version # has not changed.) Still does not work with CiviMail and errors when running on fields in question. doctorwhen error

aniesshsethh commented 6 years ago

facing the same issue

MegaphoneJon commented 6 years ago

@aniesshsethh Could you please indicate: a) the version of CiviCRM you're seeing this with? b) the version of MySQL you're running? c) the most recent commit of the Doctor When version you're running?

aniesshsethh commented 6 years ago

@MegaphoneJon Sorry, This was fixed via https://github.com/civicrm/civicrm-core/pull/11361

Thanks for the quick response.