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

CRM-18397: Don't add empty billing name to non-existent billing address #8122

Merged
merged 3 commits into from
May 18, 2016

Conversation

JKingsnorth
Copy link
Contributor

@monishdeb
Copy link
Member

@JKingsnorth can I close this in favor of #8176 ?

@JKingsnorth
Copy link
Contributor Author

Well at the moment this solution is more functional than the other. It depends if the QAers want to refine the other PR or if they have any comments for me to improve on this one.

@monishdeb
Copy link
Member

Sorry for delay, seems like rohan has already made some changes in his PR #8176 on some of the flaw you mentioned in the ticket itself.

@eileenmcnaughton
Copy link
Contributor

Accepting this makes me die a little inside. I would so much prefer to consolidate with

$this->formatParamsForPaymentProcessor($fields);

(used by the contribute form)

And to resolve all those questions on why we add & drop billing filling fields like they are participants in a boy band.

However, I realise I'm not game to turn this into the PR I really want to do this time around - not least because we don't have CI tests on event forms yet.

So, perhaps as a compromise we could just brutalise the code with comments.

@@ -1052,6 +1052,9 @@ public static function fixLocationFields(&$params, &$fields, &$form) {
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is largely a duplicate of the contribution function

$fields = $this->formatParamsForPaymentProcessor($fields);

However, there is a possible case where the syntax might diverge when dealing with multiple participants.

In general the contribution code is cleaner because rather than coming up with 100 & one conditions as to why we add or remove the billing fields it simply assumes that if we presented them on the form in the first place then we probably did so in order to save them

@eileenmcnaughton eileenmcnaughton merged commit 7e982a3 into civicrm:master May 18, 2016
@eileenmcnaughton
Copy link
Contributor

Merged! Your comments are so polite too...

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

Successfully merging this pull request may close these issues.

4 participants