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

Return early if edit post screen #2831

Merged
merged 4 commits into from
Jun 20, 2022
Merged

Return early if edit post screen #2831

merged 4 commits into from
Jun 20, 2022

Conversation

oscarssanchez
Copy link
Contributor

@oscarssanchez oscarssanchez commented Jun 7, 2022

Description of the Change

This PR returns the setup() method early if we are in a post editor context, as there's no need to run the facets code if we are adding/editing a post.

There's other alternatives to this like whitelisting blocks via allowed_block_types_all however we would need to know all blocks registered, which can be tricky.

Closes #2797

Alternate Designs

Possible Drawbacks

Verification Process

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Changelog Entry

Fixed: Facet block can be used in the post editor.

Credits

Props @oscarssanchez

@felipeelia felipeelia merged commit 6786634 into develop Jun 20, 2022
@felipeelia felipeelia deleted the fix/facet-block-setup branch June 20, 2022 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Facet block doesn't render anything on frontend for single post
2 participants