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-compat][REF] Fix some more test failures in php8 #20516

Merged
merged 1 commit into from
Jun 6, 2021

Conversation

seamuslee001
Copy link
Contributor

Overview

This fixes the following test failures on php8

  • CRM_Campaign_BAO_PetitionTest::testPetitionEmailWithDomainTokens
    Undefined array key "survey_id"
  • Civi\Test\ExampleHookTest::testPageOutput
    Undefined array key "urlIsPublic"
  • CRM_Event_Form_ParticipantTest::testTransferParticipantRegistration
    TypeError: Unsupported operand types: array & int

Before

Those tests fail on php8

After

Those tests pass on php8

ping @eileenmcnaughton @totten @demeritcowboy

@civibot
Copy link

civibot bot commented Jun 6, 2021

(Standard links)

@civibot civibot bot added the master label Jun 6, 2021
@@ -1360,7 +1360,7 @@ public function submit($params) {
}

// also store lineitem stuff here
if ((($this->_lineItem & $this->_action & CRM_Core_Action::ADD) ||
if ((($this->_lineItem && $this->_action & CRM_Core_Action::ADD) ||
Copy link
Contributor

Choose a reason for hiding this comment

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

This makes me a little nervous as the impact might be to change behaviour - I agree it looks like a bug but sometimes fixing bad code breaks things - have we branched yet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nope

Copy link
Contributor

Choose a reason for hiding this comment

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

I stepped through this in the code &

  1. $this->_lineItem is always set for paid events & unset for unpaid events and
  2. the behaviour is unchanged by this change

@eileenmcnaughton eileenmcnaughton merged commit cdef01c into civicrm:master Jun 6, 2021
@eileenmcnaughton eileenmcnaughton deleted the php8_more_test_fixes branch June 6, 2021 21:58
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