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: a PHP warning when editing newsletters #722

Merged
merged 1 commit into from
Mar 25, 2021

Conversation

dkoo
Copy link
Contributor

@dkoo dkoo commented Mar 24, 2021

All Submissions:

Changes proposed in this Pull Request:

Avoids a PHP warning thrown when editing a Newspack newsletter CPT. It's another question why the Blocks handler is running at all on a CPT that doesn't register any blocks from Newspack Blocks, but this should fix the warning wherever it might happen.

How to test the changes in this Pull Request:

  1. On master, create or edit a newsletter in the Newspack Newsletters plugin.
  2. Observe a PHP notice in your debug.log like this:
[24-Mar-2021 16:05:09 UTC] PHP Notice:  Trying to access array offset on value of type bool in /newspack/app/public/wp-content/plugins/newspack-blocks/includes/class-newspack-blocks.php on line 285
  1. Check out this branch, refresh the editor page. Confirm that the warning is no longer thrown.

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 added the bug Something isn't working label Mar 24, 2021
@dkoo dkoo self-assigned this Mar 24, 2021
@dkoo dkoo merged commit 41ce40e into master Mar 25, 2021
@dkoo dkoo deleted the fix/php-warning-newsletters branch March 25, 2021 15:35
matticbot pushed a commit that referenced this pull request Mar 30, 2021
## [1.22.1-alpha.1](v1.22.0...v1.22.1-alpha.1) (2021-03-30)

### Bug Fixes

* a PHP warning when editing newsletters ([#722](#722)) ([41ce40e](41ce40e))
@matticbot
Copy link
Contributor

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

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Mar 30, 2021
## [1.22.1](v1.22.0...v1.22.1) (2021-03-30)

### Bug Fixes

* a PHP warning when editing newsletters ([#722](#722)) ([41ce40e](41ce40e))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.22.1 🎉

The release is available on GitHub release

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.

3 participants