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
Allow configuring required address comonents #48
Conversation
What's that part for exactly? de.systopia.twingle/api/v3/TwingleDonation/Submit.php Lines 332 to 334 in 4659b53
|
This removes e.g. the |
But the condition is always
|
It is. I think I imagined new parameters could have the same name and the code would be prepared for it. Consider it a foresighted clean-up ;-) |
@jensschuppe, any objections to pulling this? It looks sensible and @mariav0 confirmed that it works for her... And afaik there's no other address parameters submitted by twingle. |
@bjendres I haven't merged it yet, because
|
As far as I know, Twingle does not submit empty fields. But I can check this, if you want. |
Okay, I checked it: Twingle does submit empty address data fields. So we should include another check |
@MarcMichalsky Could you rebase this on the current |
The required address components can be selected in the corresponding profile.
Okay, that should be it. The check for empty address parameters is already done here: de.systopia.twingle/api/v3/TwingleDonation/Submit.php Lines 324 to 336 in 1975639
|
api/v3/TwingleDonation/Submit.php
Outdated
@@ -347,7 +347,12 @@ function civicrm_api3_twingle_donation_Submit($params) { | |||
} | |||
} | |||
if ($unset_address_params) { | |||
foreach($required_address_components as $req) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I had a knot in my brain here. 🧠
I did some slight changes in 6779349 and merged to @MarcMichalsky you might want to re-run your tests on that, but the code looks good to me. I went ahead merging it in order to move on towards a pre-release. |
This is a real KISS solution. And to be honest, I am not exceedingly proud of it. But it works and I think its simple nature makes it easily understandable for everyone.
I understand this PR as a voluntary act of mine to improve this cool open source software. It's just an offer and I do not demand you to pull it. So, there's no need to send a bill. 😬
fix #47