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

EP Related Block: In widgets edit screen, use postId = 0 #2353

Merged
merged 3 commits into from
Sep 23, 2021

Conversation

felipeelia
Copy link
Member

Description of the Change

While using the ElasticPress Related Posts block in the Widgets Edit Screen, we get an infinite loading state as we can't use wp.data.select('core/editor').getCurrentPostId() in that scenario. This PR checks if it is available or not, defaulting to 0 (otherwise null will be used, resulting in a 404 /wp/v2/posts/null/related REST endpoint

Changelog Entry

Fixed: infinite loading state of ElasticPress Related Posts block in the Widgets Edit Screen

@felipeelia felipeelia added this to the 3.6.3 milestone Sep 20, 2021
@felipeelia felipeelia self-assigned this Sep 20, 2021
@felipeelia felipeelia merged commit 29f1e65 into develop Sep 23, 2021
@felipeelia felipeelia deleted the fix/ep-related-block-as-widget branch September 23, 2021 13:50
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