JSON Error Prevents Block Previews
-
EditorsKit prevents the preview of non standard blocks in the page editor screen.
Block previews work fine when EditorsKit is disabled. When EditorsKit is enabled and all its features disabled block previews still do not show. Plugins I know to be affected include WP Recipe Maker and Tasty Links.
Editor requests that are blocked when EditorsKit is enabled look like this (we can change wp-recipe-maker to any other plugin’s request path and the result is the same):
/wp-json/wp/v2/block-renderer/wp-recipe-maker/recipe?context=edit&attributes%5Bid%5D=8622&attributes%5Btemplate%5D=&attributes%5Bupdated%5D=1580499186151&attributes%5Beditorskit%5D%5Bdevices%5D=false&attributes%5Beditorskit%5D%5Bdesktop%5D=true&attributes%5Beditorskit%5D%5Btablet%5D=true&attributes%5Beditorskit%5D%5Bmobile%5D=true&attributes%5Beditorskit%5D%5Bloggedin%5D=true&attributes%5Beditorskit%5D%5Bloggedout%5D=true&attributes%5Beditorskit%5D%5Bacf_visibility%5D=&attributes%5Beditorskit%5D%5Bacf_field%5D=&attributes%5Beditorskit%5D%5Bacf_condition%5D=&attributes%5Beditorskit%5D%5Bacf_value%5D=&attributes%5Beditorskit%5D%5Bmigrated%5D=false&attributes%5Beditorskit%5D%5Bunit_test%5D=false&attributes%5BhasAlignmentOption%5D=true&post_id=6524&_locale=user
The network response looks like this:
{"code":"rest_invalid_param","message":"Par\u00e1metro(s) no v\u00e1lido(s): attributes","data":{"status":400,"params":{"attributes":"hasAlignmentOption no es una propiedad v\u00e1lida del objeto."}}}
Affected blocks show the following text:
Error loading block: Invalid parameter(s): attributes
I tested with and without the Gutenberg feature plugin enabled. The problem is present in both cases.
There are no EditorsKit related error messages logged in the WordPress file space (error_logs), by the web server (as far as I can see) or sent to me via Fatal Error Notify (a WordPress error monitor plugin).
I see there is another support request about block previews from 4 weeks ago and an earlier support request that mentions an issue with the ‘Alignment’ property. Maybe the same issue is in play. The network response in my case points toward an issue with hasAlignmentOption.
Hope we can solve this one quickly. Let me know if you want me to run any tests.
- The topic ‘JSON Error Prevents Block Previews’ is closed to new replies.