Body: <p>On a site that I've been looking after for over 10 years (and which therefore has gone through a lot of Civi upgrades, currently on 5.24.x) I've just turned on the invoicing feature.
  The problem is that I have no message template entitled 'Contributions - Invoice" that I can edit. Checking the database there is no entry for this message template.</p>
  
  <p>I can get the system to generate and send an invoice so there must be some template code somewhere that is doing this.</p>
  
  <p>I copied the relevant database row from another installation and added this to my database, so it's now showing up in the UI, but any edits I make to this template are ignored by Civi.</p>
  
  <p>So my question is how can I fix this issue? I'm assuming that the code that generates the invoice is not recognising my bodged message template and is therefore falling back on some internal base template. Maybe it expects the editable/edited message template to have a certain id that my attempt to fix has overlooked.</p>
  
  <p>Any pointers as to how I might be able to resolve this and so be able to use an edited invoice template are most welcome.</p>
  
  <p>I'm thinking the only other option may be some sort of major database rebuild using a current schema, which I'm keen to avoid getting into.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-16T14:18:26.703Z
Comments.Text: Have you got logging turned on? The previous version might be in the log_ table?
Comments.UserDisplayName: Parvez Saleh
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-16T15:02:46.140Z
Comments.Text: Thanks. Logging isn't on for this installation.
Comments.UserDisplayName: Graham
Tags: <civicontribute><message-templates><invoice>
Title: How to fix a broken invoice message template?
ThreadText: # How to fix a broken invoice message template?
  
  (Asked by: username_0 on 2020-04-16)
  
  On a site that I've been looking after for over 10 years (and which therefore has gone through a lot of Civi upgrades, currently on 5.24.x) I've just turned on the invoicing feature.
  The problem is that I have no message template entitled 'Contributions - Invoice" that I can edit. Checking the database there is no entry for this message template.
  
  I can get the system to generate and send an invoice so there must be some template code somewhere that is doing this.
  
  I copied the relevant database row from another installation and added this to my database, so it's now showing up in the UI, but any edits I make to this template are ignored by Civi.
  
  So my question is how can I fix this issue? I'm assuming that the code that generates the invoice is not recognising my bodged message template and is therefore falling back on some internal base template. Maybe it expects the editable/edited message template to have a certain id that my attempt to fix has overlooked.
  
  Any pointers as to how I might be able to resolve this and so be able to use an edited invoice template are most welcome.
  
  I'm thinking the only other option may be some sort of major database rebuild using a current schema, which I'm keen to avoid getting into.
  
  **Tags:** civicontribute, message-templates, invoice
  
  > **Comments:**
  > **username_1**: Have you got logging turned on? The previous version might be in the log_ table?  
  > **username_0**: Thanks. Logging isn't on for this installation.  
  
  ---
  
  ## 0 answers
  
  