I need a customized invoice generation. So I thought that would be pretty straightforward: I use the civicrm_post hook on Contribution when the invoice ID is updated. Unfortunately the contribution post hook is not called when the invoice_id is updated. Any suggestion on how I tackle this now for this specific instance (and yes, I will also add a PR for a core change to call the post hook when the invoice id is updated in the contribution)?
I have temporarily solved it by making a change to the core CRM_Contribute_Form_Task_Invoice to use my function for invoice generation if the class I use can be found. Temporary fix for the customer with their current version.
What I am planning on doing as a core PR is taking out the invoiceId generation in CRM_Contribute_Form_Task_Invoice and replace it with an API call: Invoice Generate. That means anyone who wants to customize it can use the apiWrapper hook to do so. Does that make sense?