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 in give-export-donations-exporter.php #7417

Merged
merged 2 commits into from
Jul 10, 2024

Conversation

Genevieve-K
Copy link
Contributor

@Genevieve-K Genevieve-K commented Jun 20, 2024

Resolves GIVE-958

The meta 'razorpay_donation_response' is an array. Must be serialized to avoid a fatal error:

TypeError: Uncaught TypeError: substr(): Argument #1 ($string) must be of type string, array given in /var/www/html/wordpress/wp-content/plugins/give/includes/admin/tools/export/give-export-donations-exporter.php:684

To test:

  • activate give-razorpay
  • export donations
  • choose a donation form
  • select the custom field column razorpay_donation_response

The meta 'razorpay_donation_response' is an array. Must be serialized to avoid a fatal error:
TypeError: Uncaught TypeError: substr(): Argument impress-org#1 ($string) must be of type string, array given in /var/www/html/wordpress/wp-content/plugins/give/includes/admin/tools/export/give-export-donations-exporter.php:684
@jonwaldstein
Copy link
Contributor

@glaubersilva since you are working on razorpay, could you review this please?

Copy link
Contributor

@glaubersilva glaubersilva left a comment

Choose a reason for hiding this comment

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

@Genevieve-K Thanks for the fix!

I wasn't able to reproduce this bug on PHP 7.4.3 but was able to reproduce it with PHP 8.1.23 and could confirm that your fix is working as expected.

The code looks good to me, but I noticed a minor thing related to a missing @unreleased tag. I left a comment with more details about it. Let me know if you have any questions!

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.

@glaubersilva glaubersilva self-requested a review July 10, 2024 18:32
@glaubersilva glaubersilva merged commit f47aec8 into impress-org:develop Jul 10, 2024
16 checks passed
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.

4 participants