Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When uc_recurring_renew() executes it creates a new renewal order (if one does not already exist) but the link between the original order and the renewal order, stored in 'uc_recurring_orders', is only created if the payment is successful. This means that a renewal order that failed payment is not visible on the admin order recurring fees tab (admin/store/orders/{order_id}/recurring).
The reference should be saved when the renewal order is created and does not depend on the payment being successful.
Comment | File | Size | Author |
---|---|---|---|
#2 | uc_recurring-renewal_order_ref-2579479-1.patch | 1.13 KB | tinker |
Comments
Comment #2
tinker CreditAttribution: tinker as a volunteer commentedThis patch moves the renewal order reference creation into uc_recurring_create_renewal_order() so that it is only executed once when the renewal order is created.
Comment #3
tinker CreditAttribution: tinker as a volunteer commentedNote: This patch is not retro active and could lead to existing renewal orders that failed payment to NOT be linked to the original order. Patch operation is still better that current operation. Ideally this patch should include a hook_update_N() to find all renewal orders that do not have a reference in 'uc_recurring_orders' and add one.
Comment #4
glynster CreditAttribution: glynster commented@tinker, I just tried to apply this patch but I think there is an order issue, as the patch failed. Do I need to apply this patch first and then your patch list from Fee operation links access control faulty, wrong arguments on admin fees overview page. Excited to get this tested!
Comment #5
tinker CreditAttribution: tinker as a volunteer commented@glynster, This is why maintaining a patched version is so difficult. All patches are made to apply to clean 7.x-2.x-dev and assume that no other patches have been applied. If your working version has many patches then you have to merge or manually apply the patch. If you want help you can provide the error message that you got when you tried to apply the patch. BTW I will be gone for a few days so be patient for my response.
Comment #6
glynster CreditAttribution: glynster commented@tinker, perfect thanks for the feedback that is what I thought, so I will manually apply this patch and see what the result is. The good thing here is I only have 1 patch at the moment. Will keep you posted.
Comment #7
glynster CreditAttribution: glynster commented@tinker, and as always your patch works a treat. Just had a couple of subscriptions fail and are in pending mode and they all remain connected as they should. You rock. As you say it would be awesome to run a small script to update all the past orders but otherwise the issue completely. +1 to have this committed.
Comment #8
glynster CreditAttribution: glynster commented@tinker, have tested this on production for 3 days now and it works a treat. +1 to have this committed to dev.
Comment #9
glynster CreditAttribution: glynster commentedI think it is time to RTBC.