RecurringOrderManager calls onSubscriptionRenew before updating subscription

Created on 30 January 2023, almost 2 years ago
Updated 9 January 2024, 11 months ago

Hi there.

While testing renewals for our live website, we've found that the renewOrder method of RecurringOrderManager invokes the onSubscriptionRenew method for the subscription type before it updates the renewed time and other attributes of the subscription. This causes an error in our situation because a newly created subscription has a NULL value on the renew field and the commerce_license module's LicenseSubscription class's onSubscriptionRenew method does:

$license->setRenewedTime($subscription->getRenewedTime())

setRenewedTime doesn't accept NULL as an argument, causing the error.

I propose moving the updating of the subscription attributes to prior to the onSubscriptionRenew method, but leaving the save call where it is. MR coming.

Regards,

Nij

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇦🇺Australia nigelcunningham Geelong

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024