Details
Description
If you try to delete a message template that is referenced by a mailing (using Administer Civ >> Configure >> Message Templates >> Delete - we throw a fatal error:
Database Error Code: Cannot delete or update a parent row: a foreign key constraint fails (`civicrm_19/civicrm_mailing`, CONSTRAINT `FK_civicrm_mailing_msg_template_id` FOREIGN KEY (`msg_template_id`) REFERENCES `civicrm_msg_template` (`id`)), 1451
We should set the msg_template_id NULL and continue w/ delete.