Open inc2734 opened 2 years ago
I'm able to reproduce this in Gutenberg 12.3.0
I created a test block at https://gitlab.com/cpl/test-case--36339
it was made from create-block
.
Console error returns the following:
Specifically appears rest_block_directory_cannot_view
XHR GET https://mysite.test/wp-json/wp/v2/block-directory/search?term=block:create-block/test-case-36339&_locale=user
[HTTP/2 403 Forbidden 600ms]
1
{"code":"rest_block_directory_cannot_view","message":"Sorry, you are not allowed to browse the block directory.","data":{"status":403}}
Hello @inc2734 thanks for the report, I'm able to reproduce the bug thanks to @skorasaurus plugin. I found that the error is due to users with "Editor" role has not _unfilteredhtml capability that means the post content will be filtered and striped by using _wp_kses_ (WordPress core function). And there is the problem _wpkses transform the block comment... I don't really know how to fix it in Gutenberg, but what I can suggest right now is to use a third party plugin to add _unfilteredhtml capability to Editor .
If you have any other thoughts, please share them.
Regards.
Console error returns the following:
Specifically appears
rest_block_directory_cannot_view
XHR GET https://mysite.test/wp-json/wp/v2/block-directory/search?term=block:create-block/test-case-36339&_locale=user [HTTP/2 403 Forbidden 600ms] 1 {"code":"rest_block_directory_cannot_view","message":"Sorry, you are not allowed to browse the block directory.","data":{"status":403}}
This one is appear even when your plugin is disable. It's appear for user with role Editor so I don't think it is related to the main issue here, may be it's worth another issue. I don't find the cause though.
Hello @mauriac ! Do you think it is possible to adapt "wp_kses" to not filter the name of the blocks? Or to let the use of several hyphens?
Description
When the user role is author, blocks cannot be edited if the block name contains consecutive hyphens (unsupported). I want it to appear the same way in all roles.
I couldn't decide if such naming conventions were not allowed or if it was a bug, so I raised an issue.
Step-by-step reproduction instructions
When editor and administrator, This does not occur.
Screenshots, screen recording, code snippet
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
No