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

Hot Fix: prevent PHP 8+ fatal errors when Tributes add-on is enabled #7572

Merged

Conversation

glaubersilva
Copy link
Contributor

@glaubersilva glaubersilva commented Oct 15, 2024

Resolves GIVE-1306

Description

The problem was happening on PHP 8+ because the ltrim() method on those versions is more restrictive about which type of parameter is accepted. In previous versions, not-string values only threw wanings but in PHP 8+ version it threw a fatal error that prevented the donation workflow.

So, the solution was to prevent the use of values different from a string on the ltrim() method.

Affects

Option-based forms with the Tributes add-on enabled.

Testing Instructions

  1. Create a v2 form and enable Tributes;
  2. Make a donation but do not opt-in for Tributes;
  3. The donation should be finished without fatal errors.

Pre-review Checklist

  • Acceptance criteria satisfied and marked in related issue
  • Relevant @unreleased tags included in DocBlocks
  • Includes unit tests
  • Reviewed by the designer (if follows a design)
  • Self Review of code and UX completed

@glaubersilva glaubersilva self-assigned this Oct 15, 2024
@glaubersilva glaubersilva changed the title Hot Fix: prevent PHP 8+ fatal error when Tributes add-on is enabled Hot Fix: prevent PHP 8+ fatal errors when Tributes add-on is enabled Oct 15, 2024
@glaubersilva glaubersilva marked this pull request as ready for review October 15, 2024 13:43
Copy link
Contributor

@jonwaldstein jonwaldstein left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!

@jonwaldstein jonwaldstein changed the base branch from master to release/3.16.5 October 15, 2024 14:24
Copy link
Member

@rickalday rickalday left a comment

Choose a reason for hiding this comment

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

Passed manual QA tests

@jonwaldstein jonwaldstein merged commit 9bfae6c into release/3.16.5 Oct 15, 2024
20 checks passed
@jonwaldstein jonwaldstein deleted the hotfix/php-fatal-error-tributes-GIVE-1306 branch October 15, 2024 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants