Problem/Motivation

If checkbox "All" for setting allowed content block types is ticked without ticking any of the content types (so that configuration array CONTENT_TYPE_allowed_content_block_types has only value 'content-block/all'), content blocks are not visible on Gutenberg editor.

Steps to reproduce

1. Navigate to edit some content type eg. /admin/structure/types/manage/page
2. Tick Gutenberg experience -> Allowed content block types -> All
3. Create content block type (/admin/structure/block-content/add)
4. Create content block of the same type (/block/add)
5. Navigate to edit content with Gutenberg editor. It must be the same type as in step 1.
6. Look for the block created in step 4.

Proposed resolution

Take value 'content-block/all' into account inside BlocksController.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork gutenberg-3501425

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jessesivonen created an issue. See original summary.

kul.pratap’s picture

Assigned: Unassigned » kul.pratap

Working on it.

kul.pratap’s picture

Assigned: kul.pratap » Unassigned
Status: Active » Needs review
StatusFileSize
new68.84 KB
new86.86 KB

I have done the changes now all block types are showing and now we can also create block of these block types in the gutenberg editor.
Attaching screenchot for reference:

Before Changes:/

before

After Changes

After

Please review.

Thanks

sayan_k_dutta’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new98.62 KB
new101.41 KB

Reviewed the MR. The changes seem to resolve the issue. All the custom blocks created are now visible under blocks options in gutenberg editor. Attaching screenshots for the same and moving this to RTBC.

codebymikey’s picture

Status: Reviewed & tested by the community » Needs work

I think a more global change also needs to be made to how the Gutenberg Experience settings work.

Such that upon selecting "All":
1. All the other blocks are automatically ticked (just like the current behaviour is).
2. All the other blocks are also disabled.
3. The only setting that will be in the config would be "all", rather than duplicating all the other stuff.

Currently "All" only ticks the blocks which are currently available, and won't pick up new entries.

A post update hook might also be necessary to clean the existing configs up to marry up (but it's not strictly necessary for an MVP).