-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Hotfix for publishing pages #9161
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Troubling that our new page-publishing test didn't catch this one, that's worth looking into 😢
Yeah :( I'll do that today. Need to dig into how taxonomies are retrieved and modify that test case. |
@@ -60,7 +60,7 @@ export default compose( | |||
withSelect( ( select ) => { | |||
const postType = select( 'core/editor' ).getCurrentPostType(); | |||
const tagsTaxonomy = select( 'core' ).getTaxonomy( 'post_tag' ); | |||
const tags = select( 'core/editor' ).getEditedPostAttribute( tagsTaxonomy.rest_base ); | |||
const tags = tagsTaxonomy && select( 'core/editor' ).getEditedPostAttribute( tagsTaxonomy.rest_base ); | |||
return { | |||
areTagsFetched: tagsTaxonomy !== undefined, | |||
isPostTypeSupported: tagsTaxonomy && tagsTaxonomy.types.some( ( type ) => type === postType ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW on the line below this one we're passing hasTags
, which reads as though it's a boolean value, but following the &&
and its behavior of using the lefthand value, we're likely passing null
or undefined
when there are no tags, not false
.
Making a point of it here only because this tends to be overlooked in applying the &&
pattern for conditions, added here.
@nosolosw Can we make sure merged pull requests are assigned to milestones, please? |
Additional fix for #9054