Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not overwrite details with empty values #78

Closed
MarcMichalsky opened this issue Feb 26, 2021 · 6 comments
Closed

Do not overwrite details with empty values #78

MarcMichalsky opened this issue Feb 26, 2021 · 6 comments

Comments

@MarcMichalsky
Copy link
Contributor

Hello,

we recently faced the problem that existing address data were removed when the "Change Primary Detail?" option was checked. This happens if we receive a donation via TwingleDonation.submit that does not contain any address information.

I am not sure if this behaviour is intended or not, but it is kind of counterintuitive. I would expect the XCM to overwrite data only with new data.

This is our XCM config:
XCM_config

@bjendres
Copy link
Member

@MarcMichalsky Are you sure that all of these attributes were empty in your incoming data? If so, it shouldn't have done anything, see here.

@MarcMichalsky
Copy link
Contributor Author

I tested it again with this json in the call:

{"project_id":"tw5f64adce40693","trx_id":"foobar5","parent_trx_id":null,"confirmed_at":20210226110000,"purpose":"Allgemeine Spende","amount":2800,"currency":"EUR","user_email":"m.michalsky@posteo.de","user_country":"DE","user_language":"de","payment_method":"paypal","donation_rhythm":"one_time","is_anonymous":0,"newsletter":1,"postinfo":0,"donation_receipt":1,"user_gender":"male","user_title":null,"user_firstname":"Marc","user_lastname":"Michalsky", "custom_fields":{}}

My address data got removed.

@MarcMichalsky
Copy link
Contributor Author

MarcMichalsky commented Feb 26, 2021

Oh, wait, the country remains what means that the country_id attribute was filled anywhere. I will have a closer look into this later. Maybe this Issue belongs to the de.systopia.twingle repository.

EDIT: Okay, it's the county_id not country_id but anyway, I think this might produce a new address that overwrites the old one.

@bjendres
Copy link
Member

@MarcMichalsky should I flag this as invalid, then?

@MarcMichalsky
Copy link
Contributor Author

@MarcMichalsky should I flag this as invalid, then?

I think it's invalid here, in the XCM-Repro, because there is nothing wrong about how the XCM treats this. But I think other de.systopia.twingle users could run into the same problem, because the country is always transmitted along with a PayPal donation. Maybe we should mention it in the XCM section of the de.systopia.twingle documentation. I'll maybe send a PR there.
Thank you so far!

@bjendres
Copy link
Member

Thanks to you for raising it. Now we have it documented for the next person to come along...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants