Steps to reproduce:

- Create a billing cycle type, e.g. Monthly
- Check the billing_cycle_type_id in the DB. Let's say in this example that it's 1
- Edit the billing cycle type and change something, e.g. the label or whether it's asynchronous or not
- Now, on the overview screen, click the revert link next to the cycle type and confirm reverting it.
- Check in the DB again. The ID will now have increased (because the type got deleted and recreated). If there were products using this billing cycle type, they will now show "None" when edited and have to be reassociated.

I am attaching a patch that fixes this. It's doubtful that my fix is the best way to accomplish this, but it does work. Hopefully someone can think of a better way.

Comments

wizonesolutions created an issue. See original summary.

wizonesolutions’s picture

Status: Active » Needs review
Issue tags: +Needs tests
StatusFileSize
new1.28 KB
wizonesolutions’s picture

MIs-patch, fixing.

wizonesolutions’s picture

StatusFileSize
new4.05 KB
wizonesolutions’s picture

StatusFileSize
new3.77 KB

Previous patch is still weird (needs -p2) — here is one that is more normal (probably only needs -p1).

wizonesolutions’s picture

StatusFileSize
new4.06 KB

Whoops! I subclassed the wrong class. This patch is fixed.