- πΊπΈUnited States morbus iff
This patch appears to be partly responsible for critical error in 3.0-rc1: https://www.drupal.org/project/commerce_license/issues/3362663 π RC1: Can't add more than one digital product to cart Fixed
(I could have sworn there was an issue for this, but I can only find a 7.x one that I don't want to hijack.)
Rough notes:
- the availability checker for ownership of a grantable gets in the way
- we probably still need to prevent re-purchase of a license product early on in the license's lifetime. That suggests a setting on the PV to say 'renewals may be purchased within interval X from expiry'.
- the availability checker thus needs to know whether there is a license, as well as the grantable. The logic becomes:
- got license? yes:
- is it unlimited? may not purchase
- are you in the renewal period? yes: may purchase
- got license? no:
- do you have the grantable? yes: may not purchase
- the cart should show a clear message that the user is purchasing a renewal, and what date they are extending to
- something needs to place the existing license on the order item in the new order
- the order sync class needs to know it's a renewal, and at the point where it would normally activate, extend instead
- the code that deletes a license when an order item is deleted needs to account for this process, and NOT delete the license
- tests. all the tests.
Tests that needs to be done:
Fixed
2.0
Code
The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
This patch appears to be partly responsible for critical error in 3.0-rc1: https://www.drupal.org/project/commerce_license/issues/3362663 π RC1: Can't add more than one digital product to cart Fixed