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: moving check for sponsors to prevent notices #573

Merged
merged 1 commit into from
Aug 18, 2020

Conversation

laurelfulford
Copy link
Contributor

All Submissions:

Changes proposed in this Pull Request:

Similar to Automattic/newspack-theme#1032, this PR moves the check for sponsors so it doesn't throw an error when the Newspack Sponsors plugin is not installed.

How to test the changes in this Pull Request:

  1. Start with a test site with the Newspack Sponsors plugin disabled, and set up some Homepage Posts and Post Carousel Blocks. Make sure wp_debug is enabled.
  2. View on front-end; note each block throws an error, Notice: Undefined variable: sponsors in /srv/www/newspack-build/public_html/wp-content/plugins/newspack-blocks/class-newspack-blocks.php on line 530.
  3. Apply the PR and confirm the errors go away.
  4. Activate the Newspack Sponsors plugin, and make the sponsor flair (flag, logos and byline) still show up for Homepage Posts and Post Carousel blocks with native sponsors, on the front-end and in the editor.

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?

Copy link
Contributor

@dkoo dkoo left a comment

Choose a reason for hiding this comment

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

Thanks for fixing! Works both with and without the plugin now, with no warnings.

@laurelfulford
Copy link
Contributor Author

Thanks Derrick! 🙌

@laurelfulford laurelfulford merged commit 0cd9810 into master Aug 18, 2020
matticbot pushed a commit that referenced this pull request Aug 18, 2020
# [1.11.0-alpha.2](v1.11.0-alpha.1...v1.11.0-alpha.2) (2020-08-18)

### Bug Fixes

* moving check for sponsors to prevent notices ([#573](#573)) ([0cd9810](0cd9810))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.11.0-alpha.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Aug 18, 2020
## [1.11.1](v1.11.0...v1.11.1) (2020-08-18)

### Bug Fixes

* moving check for sponsors to prevent notices ([#573](#573)) ([0cd9810](0cd9810))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.11.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@laurelfulford laurelfulford deleted the fixes/sponsor-notice branch November 12, 2020 17:34
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.

3 participants