-
Notifications
You must be signed in to change notification settings - Fork 2
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: Back-port compatibility fixes for wp-graphql-content-blocks to SnapWP Helper plugin #28
Conversation
…ers from model-compat branches
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.
Overall the backport looks good.
Fix the comments, fill out the PR description and this should be ready.
@@ -37,11 +37,11 @@ final class SchemaFilters implements Registrable { | |||
*/ | |||
public function register_hooks(): void { | |||
// No need to check for dependencies, since missing filters will just be ignored. | |||
add_filter( 'wpgraphql_content_blocks_handle_do_block', [ ContentBlocksResolver::class, 'handle_do_block' ], 10, 1 ); |
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.
This is why we're not getting the inner blocks - you got rid of the graphql_object_fields
filter which let us overload the entire class, and instead are only overloading the internal handle_do_block()
.
Revert this and your PR should be working.
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.
Donew ✅
@@ -27,6 +27,20 @@ final class ContentBlocksResolver { | |||
public static function resolve_content_blocks( $node, $args, $allowed_block_names = [] ): array { | |||
global $post_id; |
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.
Remove this it's unused and removed in v4.2.0
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.
Removed 🚀
What
In this PR, I backported specific compatibility fixes from
wp-graphql-content-blocks
tosnapwp-helper
to resolve issues noted in issue #224. The main updates include adjustments to theContentBlocksResolver.php
and theSchemaFilters.php
file.Why
This change is necessary because
snapwp-helper
was getting incompatible withWPGraphQL Content Blocks 4.2.0
. This incompatibility was causing issues. Backporting these changes allowssnapwp-helper
to remain compatible with WPGraphQL Content Blocks plugin.Related Issue(s):
Closes https://github.com/rtCamp/headless/issues/231
How
src/Modules/GraphQL/Data/ContentBlocksResolver.php
src/Modules/GraphQL/SchemaFilter.php
wp-graphql-content-blocks
intosnapwp-helper
.Testing Instructions
Screenshots
Checklist