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

[php8-compact] Fix Event Form test for php8 by setting totalAmount in… #20623

Merged

Conversation

seamuslee001
Copy link
Contributor

… the form params

Overview

This fixes the following test failure on php8

CRM_Event_Form_Registration_ConfirmTest::testOnlineRegNoPrice
Exception: CRM_Core_Exception: "The system did not record payment details for this payment and so could not process the transaction. Please report this error to the site administrator."
#0 /home/jenkins/bknix-edge/build/build-2/web/sites/all/modules/civicrm/CRM/Event/Form/Registration/Confirm.php(1250): CRM_Event_Form_Registration_Confirm->postProcess()

Before

Test fails on php8

After

Test passes on php8

Technical Details

It seems that this was causing an empty string to be set https://github.com/civicrm/civicrm-core/blob/master/CRM/Event/Form/Registration/Confirm.php#L1238 which eventually caused $value['amount'] to get set to an empty string rather than 0 so the test was wrongly winding up in this part of the if https://github.com/civicrm/civicrm-core/blob/master/CRM/Event/Form/Registration/Confirm.php#L522

Comments

Anything else you would like the reviewer to note

@civibot
Copy link

civibot bot commented Jun 16, 2021

(Standard links)

@civibot civibot bot added the master label Jun 16, 2021
@seamuslee001
Copy link
Contributor Author

@eileenmcnaughton
Copy link
Contributor

Ok - it seems this winds up in keeping with what happens for a zero dollar form ui submission

@eileenmcnaughton eileenmcnaughton merged commit 659db1b into civicrm:master Jun 18, 2021
@eileenmcnaughton eileenmcnaughton deleted the fix_event_form_test_php8 branch June 18, 2021 03:15
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.

2 participants