-
-
Notifications
You must be signed in to change notification settings - Fork 824
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-20949 - Fix payment processor assignment #10734
Conversation
jitendrapurohit
commented
Jul 24, 2017
•
edited by civicrm-builder
Loading
edited by civicrm-builder
- CRM-20949: BillingBlock.tpl contains wrong paymentProcessor object on initial load of backend Contribution page.
@@ -368,7 +368,7 @@ public function assignProcessors() { | |||
|
|||
// this required to show billing block | |||
// @todo remove this assignment the billing block is now designed to be always included but will not show fieldsets unless those sets of fields are assigned | |||
$this->assign_by_ref('paymentProcessor', $processor); | |||
$this->assign_by_ref('paymentProcessor', $this->_paymentProcessor); |
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.
$processor
is the variable that iterates in the foreach loop written above and assigns the last iterated value to the paymentProcessor
var. $this->_paymentProcessor
holds the correct value that needs to be assigned.
@jitendrapurohit does the $mode parameter affect this - in theory it should be pay_later processor if mode is not set |
The handling for |
@jitendrapurohit I just looked at this again - does this have any symptoms other than an incorrect assignment? I ask because the todo says to remove those lines. I will merge this as I agree it is more correct, & if the code is going to stay we should make it right. But I'd prefer to understand why it is an issue. |
(I would also note there are other tangental bugs to getting this more correct may help with them) |
Thanks @eileenmcnaughton - I recall we had the overridden copy of With the removal of this line - I don't see |
Ok - that's a marginal reason for keeping the line - overridden tpls is not something core needs to be worry about & we actively discourage people from doing that. Having said that I think we can let this drop for now. I'm happy that the merge was at least more correct in than out. |
+1 for the first statement. I just fixed as the assignment looked wrong to me in the code. But the above explanation might contradict the requirement of this PR - #10757. Feel free to close if it doesn't make any sense to you. I might find a different way to obtain that result ;-). |
That PR is already merged & yeah - it's a bit grey - because while I don't particularly support tpl overrides you could equally be using that data in a hook (supported). The bottom line is if you may an obscure core change to support an extension usage & want it to not break then unit tests are your friend |
@jitendrapurohit pinged me to say this had been applied on a site where having a non-credit card set as default results in Direct Debit fields showing on a Pledge, even though a CC processor shows in the selector. |