Open colis opened 5 months ago
It looks like the only way to pass the schema validation is to add the rich-text
type to the ValidatorHelper
JSON_TYPES
array, e.g.
<?php
namespace WPGraphQLGutenberg\Schema;
use Opis\JsonSchema\ValidatorHelper;
class CustomValidatorHelper extends ValidatorHelper
{
const JSON_TYPES = ["null", "boolean", "number", "integer", "string", "array", "object", "rich-text"];
}
and then use the new CustomValidatorHelper
class when instantiating the Validator
$validator = new Validator( new CustomValidatorHelper() );
Related to the 6.5 Wordpress Update – to this have you noticed that the 'content' attribute on is now no longer valid on the Core Block attributes. If so have you managed to overcome this?
... on CoreParagraphBlock {
attributes {
... on CoreParagraphBlockAttributes {
align
anchor
className
content
}
}
}
@noonstudio you also need to change a couple other files
needs to be
case 'rich-text':
case 'string':
$type = 'String';
break;
needs to be
case 'html':
case 'rich-text':
Related to the 6.5 Wordpress Update – to this have you noticed that the 'content' attribute on is now no longer valid on the Core Block attributes. If so have you managed to overcome this?
... on CoreParagraphBlock { attributes { ... on CoreParagraphBlockAttributes { align anchor className content } } }
yes, just realized that.
There seems to be a validation issue with the
blocksJSON
field and WordPress 6.5.This is what I'm seeing
Due to this error the
blocksJSON
field returnsnull
. Reverting to WP 6.4 solves the problem.This is the check that fails:
https://github.com/pristas-peter/wp-graphql-gutenberg/blob/bacabca662698871ecc8b297c7af3b5b95d431c1/vendor/opis/json-schema/src/Validator.php#L554-L561
https://github.com/pristas-peter/wp-graphql-gutenberg/blob/bacabca662698871ecc8b297c7af3b5b95d431c1/vendor/opis/json-schema/src/IValidatorHelper.php#L23
Steps to reproduce:
blocksJSON
field