-
-
Notifications
You must be signed in to change notification settings - Fork 814
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-14102 - UI on contribution page config #8180
Conversation
Can one of the admins verify this patch? |
ok to test |
We follow Drupal coding standards - https://www.google.co.nz/#q=drupal+coding+standards&gws_rd=cr and that failed check is a coding standard style issue - seemingly an extra blank line. Great to see patch for this. Hopefully it can be included in next months code review cycle if we get a good turnout - see https://github.com/civicrm/civicrm-core/pull/8152/files for more about the review cycle |
I resolved the coding standard style issue here - the extra blank line on line 87 in CRM/Contribute/Form/ContributionPage/Amount.php |
Great - that particular one always catches me |
@@ -337,6 +335,7 @@ public static function formRule($fields, $files, $self) { | |||
if (isset($fields['is_pay_later'])) { | |||
if (empty($fields['pay_later_text'])) { | |||
$errors['pay_later_text'] = ts('Please enter the text for the \'pay later\' checkbox displayed on the contribution form.'); | |||
$this->addElement('checkbox', 'is_monetary', ts('Execute real-time monetary transactions')); |
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.
@vijaydwivedi75, I'm not entirely sure about the intended functionality here, but creating an element only when the formRule is triggered seems wrong to me. @eileenmcnaughton, as per issue description, when I tried a contribution with pay later membership, without checking 'Execute real time monetary transactions', I got these errors.
Notice: Undefined variable: contribution in CRM_Contribute_BAO_Contribution_Utils::processConfirm() (line 221 of /home/xxx/CRM/Contribute/BAO/Contribution/Utils.php).
Notice: Trying to get property of non-object in CRM_Contribute_BAO_Contribution_Utils::processConfirm() (line 221 of /home/xxx/CRM/Contribute/BAO/Contribution/Utils.php).
Notice: Trying to get property of non-object in CRM_Contribute_Form_Contribution_Confirm->postProcessMembership() (line 1540 of /home/xxx/CRM/Contribute/Form/Contribution/Confirm.php).
Notice: Trying to get property of non-object in CRM_Contribute_Form_Contribution_Confirm->postProcessMembership() (line 1541 of /home/xxx/CRM/Contribute/Form/Contribution/Confirm.php).
No contribution or membership was created.
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.
My fundamental belief is that that checkbox should be deprecated out of the schema. As far as I can tell if $amount > 0 then we should treat it as monetary so I would attempt to calculate that where possible.
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.
Perhaps we could remove the checkbox from the form & set it appropriately on postProcess? It would certainly take some digging to be sure that was safe though
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.
I second removing and setting on postProcess. Although, even if membership amount == 0, unchecking the box did not create contribution or membership for me.
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.
I don't think we should be creating contributions if the amount is $0 - but I suspect that could be open to debate. We definitely SHOULD be creating memberships though.
Whenever we fix something on the front end contribution page we should add a test in this class api_v3_ContributionPageTest or for backoffice this class CRM_Contribute_Form_ContributionTest or the membership class.
Otherwise we can't expect this flakey code to stay fixed.
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.
@eileenmcnaughton My concern is to allow pay later transactions without requiring real-time transactions. The widget itself seems dispensable, if I'm intuiting correctly what you hope to do with a 'Manual' payment processor. If a Manual processor is configured and no processor that accepts real-time payments are configured, then we would have a page that supports pay later payments but not real time payments. If this is the intent/outcome, then we can drop widget entirely, since it is no longer doing anything useful.
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.
I don't have a strong view about having $0 contributions. I think in the abstract it's not a good idea, but I fear in the concrete that it has become embedded in code as a smelly work-around to deal with free memberships and perhaps also 'purchases' of free event tickets.
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.
So, I believe the is_monetary (execute real time transactions) field has been redundant for as long as I can remember - ie. we can calculate whether there is an amount and we can calculate whether 'is_pay_later' is set without this field. It seems to introduce a potential for error with no gain.
In terms of this field the manual processor concept is tangental - ie. we don't need the field with, or without that concept being in play.
Re $0 transactions - I think you are probably right.
Heh Vijay as Release Manager this month, I'm trying to recruit people to help pare down the backlog of almost 100 PRs, some going back to last summer. I'm wondering if you would be able to help QA another PR if I got someone to QA this PR? |
@eileenmcnaughton as per the discussion on #8575 do we need to consider $isMonetary here to ensure $this->_value['payment_processor'] is set to manual processor here? as sooner or later is_monetary will be deprecated
|
@vijaydwivedi75 would you be willing to refactor your PR along the lines suggested by @Edzelopez and @eileenmcnaughton ? @PalanteJon would you be willing to review this PR, aiming for a narrow fix regarding UI but not changing anything wrt to eliminating $0 contributions etc? Possibly needs some further clarity on what is to be done. |
My summary of what needs to happen here is that we should either
Also WRT edsel's comments
OR
|
I agree with @eileenmcnaughton 's suggestions on status and possible directions. So @vijaydwivedi75 if you want to rewrite according to new direction, that would be great, but you shouldn't feel compelled to put in all that extra effort. Would be great to hear your thoughts, and if we don't hear one way or the other by the end of the week then we should close this. |
We haven't heard from @vijaydwivedi75, and it is now a couple of months. @JoeMurray, do you have access to close this as you had suggested a few months ago? |
Also the PR gone stale. Am closing this PR now |
CRM-14102: UI on contribution page config -Execute real-time monetary transactions should not be uncheckable if $ configured
As given in link