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.