OZtree icon indicating copy to clipboard operation
OZtree copied to clipboard

Sponsor renewal does not port all information to the new sponsorship row

Open hyanwong opened this issue 3 years ago • 5 comments

@jrosindell and I have just tried renewing a species on the production server, and there appears to be a serious bug. The original row is transferred OK to the expired_reservations table, but the details remaining in the original reservations table are bad. Here are the first few fields, which are OK. Screenshot 2022-05-20 at 20 33 05

And the user_sponsor_name has transferred OK. But all the other fields, such as username, e_mail, user_sponsor_kind, user_giftaid, and all the verified_XXX fields are empty. This might be because a new row has been created for the entry (and the old one deleted), as evidenced by the fact that the ID in the snapshot above is a high number (almost the last row added to the reservations table, at the moment). I suspect (but am not sure) that we intended to copy the row to expired_reservations and then update it, rather than delete the existing row it and create new one. Is that right @lentinj.

hyanwong avatar May 20 '22 19:05 hyanwong

@lentinj - while you're on this I wonder if you could also please add to the sponsor_renew_reminder e-mail text an additional reference to that user's personal sponsorship page - currently that's referenced from the renewal html page only. I think it's nice for the user to see this from the e-mail as well.

jrosindell avatar May 20 '22 19:05 jrosindell

I'm about to push some updates to improve the e-mail template but please do check the controller serves the correct things to make it work - thanks @lentinj

jrosindell avatar May 20 '22 20:05 jrosindell

@hyanwong This sounds familiar, I suspect a patch has fallen down the back of a sofa. Will have a look tomorrow and let you know.

lentinj avatar May 22 '22 09:05 lentinj

This might be because a new row has been created for the entry (and the old one deleted), as evidenced by the fact that the ID in the snapshot above is a high number (almost the last row added to the reservations table, at the moment). I suspect (but am not sure) that we intended to copy the row to expired_reservations and then update it, rather than delete the existing row it and create new one. Is that right @lentinj.

No, this is expected. Renewing by expiring and repurchasing in a single transaction means we can share code with the expire then repurchase case.

I can't reproduce with the tests yet, will try doing something end-to-end. Just to check, this is 3.7 with https://github.com/OneZoom/OZtree/commit/0e0165c367a82de14da83502e98d86e16238ee4f ?

lentinj avatar May 23 '22 08:05 lentinj

@lentinj not it's not with 3.7 I think the server is still running 3.6

jrosindell avatar May 23 '22 09:05 jrosindell

I think this is now fixed based on the changes Yan and I made to the renewals system recently so I'm closing. Having tested it just now with another renewal all seems to be fine.

jrosindell avatar Oct 31 '22 00:10 jrosindell