- πΊπΈUnited States TomTech
Automatically closed because Drupal 7 security and bugfix support has ended β as of 5 January 2025. If the issue verifiably applies β to later versions, please reopen with details and update the version.
On a DCL project users purchase frequently cancelled service products. The current logic is when an order is cancelled then all the licenses associated with the order's line items get revoked. When users need the same services again then new orders are created, so new licenses are created and the revoked ones are never re-used.
Unfortunately, deleting the licenses trigger the commerce_license_delete_references function, which deletes all the associated line items and that in its turn empties and so deletes some orders. And unlike the licenses, which end-users never see, the orders are needed for historical purposes - PDF invoices are generated from orders, which should be always available.
Ideally, when licenses are deleted then only line-items of the relevant recurring orders should be deleted and all the other types of orders (with checked out/invoiced/paid status) should be kept intact. So I would suggest re-factor the above function and if that's not possible because of existence of massive real-time use-cases (which I can't really fancy) which need the current behavior, then I wonder what is the best way to keep database clean of outdated licenses which will never be of use again? Should I get my hands dirty by removing them with direct DB query? Might some problems pop up in that case?
Closed: outdated
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Automatically closed because Drupal 7 security and bugfix support has ended β as of 5 January 2025. If the issue verifiably applies β to later versions, please reopen with details and update the version.