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

Framework: Check post type template as non-empty #3674

Merged
merged 1 commit into from
Nov 27, 2017

Conversation

aduth
Copy link
Member

@aduth aduth commented Nov 27, 2017

See: https://github.com/WordPress/gutenberg/pull/3668/files#r153223493

This pull request seeks to resolve a notice which appears when editing a post in Gutenberg with high error reporting. Since the post type $template variable is not set, a warning is logged:

Notice: Undefined property: WP_Post_Type::$template in /srv/www/editor/htdocs/wp-content/plugins/gutenberg/lib/client-assets.php on line 786

This pull request seeks to use the empty function to test whether the $template property is both assigned and truthy.

Testing instructions:

Repeat testing instructions from #3668

Verify that there are no warnings logged with high error reporting on the editor.

@aduth aduth added the Framework Issues related to broader framework topics, especially as it relates to javascript label Nov 27, 2017
@aduth aduth requested a review from youknowriad November 27, 2017 15:16
Copy link
Contributor

@youknowriad youknowriad 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 the fix Andrew, I start to forget how to code in PHP

@aduth aduth merged commit 6576b76 into master Nov 27, 2017
@aduth aduth deleted the fix/client-assets-template-warning branch November 27, 2017 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Issues related to broader framework topics, especially as it relates to javascript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants