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 add check before trying to access yoast data store #237

Merged
merged 1 commit into from
Jul 28, 2023

Conversation

fabiankaegy
Copy link
Member

Description of the Change

Currently, the Yoast SEO plugin does not expose their data store in the site editor. (See Yoast/wordpress-seo#20473) Therefore the usePrimaryTerm hook currently produces a JS error when called in that context since all the other checks are passing. (The plugin is active and the taxonomy is supported). This adds a simple check for the existence of the data store before trying to call the selector.

How to test the Change

Changelog Entry

Fixed - Add check before trying to access yoast-seo/editor data store

Credits

Props @fabiankaegy

@fabiankaegy fabiankaegy added the [Type] Bug Something isn't working label Jun 30, 2023
@fabiankaegy fabiankaegy self-assigned this Jun 30, 2023
@github-actions
Copy link

Size Change: +133 B (0%)

Total Size: 53 kB

Filename Size Change
dist/index.js 53 kB +133 B (0%)

compressed-size-action

@fabiankaegy fabiankaegy merged commit cfa5452 into develop Jul 28, 2023
@fabiankaegy fabiankaegy deleted the fix/primary-term-hook-in-site-editor branch July 28, 2023 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant