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: Prevent warnings from displaying in form iframe #7021

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

JasonTheAdams
Copy link
Contributor

@JasonTheAdams JasonTheAdams commented Oct 10, 2023

Description

This addresses feedback such as: https://feedback.givewp.com/next-gen/p/deprecated-error-notice-when-attempting-to-migrate-a-20-form-to-30

If any kind of deprecation, error, warning, or just plain anything is written to the output buffer, it's currently showing up inside our forms and confirmation receipts. It's fine for things to show up in other places, but we specifically don't want them to show up there, in front of donors.

This clears the output buffer and sets ini_set('display_errors', 0) to prevent PHP errors (which supersedes the output buffer). This isn't a perfect system, as any errors/warnings that occur before the ini_set will still show up. As such, I put them in the router closures as the earliest point in time we could squelch the errors.

Affects

The form rendering routes

Visuals

Without this PR:
image

Testing Instructions

Use the WordPress Beta Test plugin to update to WP 6.4 beta. Then preview the form in the Form Builder (design mode), and make a donation on the front end.

Pre-review Checklist


@JasonTheAdams
Copy link
Contributor Author

@jonwaldstein Mind giving this a look over?

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.

👍

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

@JasonTheAdams JasonTheAdams merged commit e80be01 into release/3.0.0 Oct 11, 2023
9 checks passed
@JasonTheAdams JasonTheAdams deleted the fix/prevent-warnings-in-iframe branch October 11, 2023 16:18
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