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

Fix fatal error on payment edit form #19091

Merged
merged 1 commit into from
Dec 3, 2020
Merged

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Dec 3, 2020

Overview

Fixes a fatal error when editing a payment

Before

fatal error / network error when editing a payment from here

Screenshot from 2020-12-03 14-32-22

After

works

Technical Details

For what looks like copy & paste reasons defaults are loaded for 2 fields that are not on the form -net_amount & fee_amount. The switch to brick money caused passing in NULL for these to result in fatal errors.

While a case could be made to add fee amount to the form this just adjusts the form to be correct for the fields already there

Comments

@seamuslee001

@civibot
Copy link

civibot bot commented Dec 3, 2020

(Standard links)

@civibot civibot bot added the 5.32 label Dec 3, 2020
foreach ($moneyFields as $field) {
$defaults[$field] = CRM_Utils_Money::formatLocaleNumericRoundedForDefaultCurrency($this->_values[$field]);
}
$defaults['total_amount'] = CRM_Utils_Money::formatLocaleNumericRoundedForDefaultCurrency($this->_values['total_amount']);
Copy link
Contributor

Choose a reason for hiding this comment

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

@eileenmcnaughton is the gist that fee_amount and net_amount aren't exposed on this form or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@seamuslee001
Copy link
Contributor

I r-runed this on my local and it works and the changes make sense as well MOP

@totten
Copy link
Member

totten commented Dec 3, 2020

Merged base on @seamuslee001 testing.

@totten totten merged commit 5d0083d into civicrm:5.32 Dec 3, 2020
@seamuslee001 seamuslee001 deleted the form branch December 3, 2020 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants