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?

@dkoo dkoo merged commit 3af1ea7 into trunk Dec 3, 2025
8 checks passed
@dkoo dkoo deleted the feat/content-gate-restriction-rules--fixes branch December 3, 2025 17:28
@github-actions
Copy link

github-actions bot commented Dec 3, 2025

Hey @dkoo, good job getting this PR merged! 🎉

Now, the needs-changelog label has been added to it.

Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label.

If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label.

Thank you! ❤️

matticbot pushed a commit that referenced this pull request Dec 11, 2025
# [4.20.0-alpha.1](v4.19.0...v4.20.0-alpha.1) (2025-12-11)

### Bug Fixes

* avoid redeclaration of global function ([#2264](#2264)) ([3af1ea7](3af1ea7))

### Features

* supress carousel block from feeds ([#2263](#2263)) ([d0c6ad1](d0c6ad1))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 4.20.0-alpha.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Jan 5, 2026
# [4.20.0](v4.19.0...v4.20.0) (2026-01-05)

### Bug Fixes

* avoid redeclaration of global function ([#2264](#2264)) ([3af1ea7](3af1ea7))

### Features

* supress carousel block from feeds ([#2263](#2263)) ([d0c6ad1](d0c6ad1))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 4.20.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

4 participants