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

Taxonomies: Use Lodash includes to find available taxonomies #3972

merged 2 commits into from Dec 13, 2017


None yet
1 participant

aduth commented Dec 13, 2017

Workaround for #3953

This pull request seeks to change the filtering behavior of the PostTaxonomies component to use Lodash's _.includes to detect whether the current post type is contained within a taxonomy's assigned types. This is a workaround for #3953 in that the root cause of the issue is a non-schema-conforming API endpoint result. However, this provides a more immediate fix than resolving the bug in the plugin, and includes is arguably a more readable alternative to Array#indexOf !== -1.

Testing instructions:

Verify that there are no regressions in the display of taxonomies relevant for the current post type in the Gutenberg editor.

If you have Yoast SEO Premium available, verify that no crashes occur when displaying the Categories & Tags field.

Ensure that included unit tests pass:

npm run test-unit editor/components/post-taxonomies/test/index.js

@aduth aduth merged commit b0fbe03 into master Dec 13, 2017

3 checks passed

codecov/project 38.45% (+0.12%) compared to 65bf307
continuous-integration/travis-ci/pr The Travis CI build passed
continuous-integration/travis-ci/push The Travis CI build passed

@aduth aduth deleted the fix/3953-filter-taxonomies branch Dec 13, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment