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!

CommentFileSizeAuthor
uc_recurring-get_fees-6.x.patch808 bytesAlexisWilke

Comments

tinker’s picture

Status: Needs review » Reviewed & tested by the community

Wow, 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.

univate’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

This looks like it has been fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.