Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-2308

Foreign Key Error Deleting Message Template if it is Referenced by a Mailing

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9
    • Component/s: CiviMail
    • Labels:
      None

      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.

        Attachments

          Activity

            People

            • Assignee:
              sunil Sunil Pawar
              Reporter:
              dgg David Greenberg
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: