In the current version of uc_recurring_get_fees(), the $reset flag is used to force the look up of fees. However, the array is NOT actually reset! In other words, it is cumulative. The good thing is, the flag is never used.
There is also a problem when the $order exists in memory but not in the database, meaning that the order was not yet assigned an identifier. Yet, you run through the loop as if it were.
I propose a patch as attached, but if you think you will never use the $reset parameter, then you may want to consider removing that flag altogether. It does not change the fact that the fee[$order->order_id] = array(); statement should be there.
Thank you.
Alexis Wilke
P.S. Found with the help of E_ALL/E_NOTICE, I hope you'll soon consider using it on your system too!
| Comment | File | Size | Author |
|---|---|---|---|
| uc_recurring-get_fees-6.x.patch | 808 bytes | AlexisWilke |
Comments
Comment #1
tinker commentedWow, this was identified a long time ago. 3 years waiting for review. Problem still exists in 6.x-2.x-dev. Funny thing is I just made the exact same change in a cumulative fix [#3795094]. Great minds think alike huh?
I think your's stands a better chance of getting applied first.
Comment #2
univate commentedThis looks like it has been fixed.