Skip to content

Conversation

@dkoo
Copy link
Contributor

@dkoo dkoo commented Dec 2, 2025

All Submissions:

Changes proposed in this Pull Request:

Avoids a possible redeclaration fatal if the thankyou.php custom template is loaded more than once. Related to Automattic/newspack-plugin#4251.

How to test the changes in this Pull Request:

  1. While on feat(content-gate): implement restriction rules newspack-plugin#4251 and trunk of this repo, complete a modal checkout transaction on a page that renders content gates.
  2. Observe a fatal error that prevents the success modal from loading: PHP Fatal error: Cannot redeclare Newspack_Blocks\newspack_blocks_replace_login_with_order_summary() (previously declared in /newspack-repos/newspack-blocks/src/modal-checkout/templates/thankyou.php:33) in /newspack-repos/newspack-blocks/src/modal-checkout/templates/thankyou.php on line 33
  3. Check out this branch, repeat, confirm no error.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants