Hello people and big thanks to @marcofernandes for bringing the excellent Gutenberg editor to the Drupal world.

I am facing some problems with the Editor - have searched everywhere but no solution worked for me. Same bugs appear on 2 different totally clean Drupal 8.7.10 instances with latest 8.x-1.10 Gutenberg module. Hope I could get some help here.

Adding simple text/images

Adding a simple paragraph text, images, lists - everything works ok.

Drupal Media Entity block

Trying to add an image by adding the 'Drupal Media Entity' block. Console reads "index.js Uncaught (in promise) Error: Actions may not have an undefined "type" property. Have you misspelled a constant?" Note that the image is displayed normally on the frontend. Only when editing the node, my Console displays the above error. But I can still preview the image on the /edit screen. So, no big trouble here.

Drupal Media Entity with custom media types

Adding the 'Drupal Media Entity' block makes the Media library modal appear. But unexpectedly I cannot see my custom media types on the vertical menu (gutenberg-no-custom-media-type.jpg). Compare this with custom-media-type.jpg which is what i get when i try to access the media library from another content type which has an Entity Reference field. Clearly the Video, Remote Video, Youtube_Videos custom media types are missing.

Reusable Blocks

Transforming a normal block to be reusable by clicking at 'Add to Reusable blocks' successfully creates the reusable block (/admin/content/reusable-blocks) but this very block cannot be seen anymore on the /edit screen, Instead the infamous "Block has been deleted or is unavailable" message (block-is-deleted.jpg) appears where this very block used to be. If 'Visual Editor' is disabled from the Gutenberg options then i see <!-- wp:block /--> instead of <!-- wp:block {"ref":11} /--> which in my case actually prints the block. This of course means that the reusable block is not visible anymore on both frontend/backend screen.

Previous tickets showed that somehow most of those issues are solved. But i was disappointed to see that in my case it doesnt work.

Thanks in advance to anyone that could spend some time to help me on this.

Comments

pipicom created an issue. See original summary.

shane birley’s picture

I was notified today that a client is experiencing this after the upgrade to 1.10 -- we should look into this fairly quickly as it may break Gutenberg installations with previously created reusable blocks.

I tried re-saving the reusable blocks and created a new block in order to test it out but the error is persistent. I know there was a bug over here:

But I think this was fixed already.

shane birley’s picture

I did a bit of tinkering and if you create a new reusable block or re-connect a reusable block, the block will function. Once you edit the node, the reusable block will break.

pipicom’s picture

@shane-birley this is exactly what I experienced.

shane birley’s picture

I have done some additional tinkering this morning and there are no errors being tossed (at least, that I can locate). Nothing in the browser console, nothing on my test server -- the code for the blocks is stripped upon edit. You can re-add them and everything will work but that should only be considered a work around for the moment.

I have reviewed:

  • Gutenberg reusable blocks
  • Gutenberg Blocks text format
  • Gutenberg filter ordering (clean install reset and confirming the default order)
  • Permissions.

Everything looks to be "normal". I am going to dig more but any help would be amazingly awesome.

I conducted additional testing on a fresh install of Drupal 8.7.10 with a fresh install of Gutenberg and the result is the same.

shane birley’s picture

I also just want to acknowledge that the commits log is hopping the last couple of days.

@marcofernandes is an amazing beast!

I reviewed a few of them and I suspect there are two or three items in there related to what we're experiencing. I will give it a little bit more time and possibly test a dev release or... possibly a new release is imminent.

shane birley’s picture

balajidharma’s picture

Reusable Block issue

I am able to replicate same issue. I switched to code editor the "ref" is missing.

<!-- wp:block /-->

Verified on DB, the "ref" is available

<!-- wp:block {"ref":2} /-->

shane birley’s picture

marcofernandes’s picture

Reusable block issue is fixed.
Previous the core/block was being unregistered and registered back again with the ref attribute. This was how WordPress was doing too. But since we now have the registerBlock filter, things changed :)

shane birley’s picture

Status: Active » Needs review

@marcofernandes,

I have updated to the latest development release on my test box and I can confirm the issue appears to be resolved. You are awesome!

Make sure to clear the cache on your installs before testing. My previously created reusable blocks failed to load on the initial test as I forgot to clear.

shane birley’s picture

I have tested the latest development release on three separate Drupal 8 websites running Gutenberg and I am comfortable saying that the reusable block issue has been resolved.

We shall all bow to the amazingness that is @marcofernandes!

pipicom’s picture

Great news! I am testing this right now,,

pipicom’s picture

I can also confirm that there is no more issues with reusable blocks on Drupal 8.8.1 with latest 8.x-1.x-dev version of Gutenberg module.

Thank you SOOOO much @marcofernandes, @shane-birley and everybody else who helped resolve this issue.

Why isn't Gutenberg already the default editor for Drupal 8?

shane birley’s picture

@pipicom,

It isn't the default editor mainly because it isn't just an editor... it is a full page builder. But the world isn't 100% ready for such a change yet. Close, I think. But not yet. The WP community freaked out when the old editor was changed out and it resulted in a plugin being created to revert to the previous editor. I think they are allowing the plugin to work until the latter part of 2021.

pipicom’s picture

@shane-birley

Yeah, i remember the WP people freaking out on this :)
However this could be easily solved if by default Gutenberg Editor would include only the tools/blocks already present in CKEditor eg. Headings, Alignment tools, Bullet points, Paste from Word etc. Then on the Gutenberg config page (is there one?) or an "Extra Tools" submodule would make all blocks visible. This approach would cater for all type of users.

shane birley’s picture

@pipicom,

Actually, you can. If you edit the content type, you can select which Drupal blocks will be available on that content type to the Gutenberg module.

As for the formatting options (bullets, alignments, etc) that is already available in the interface. Do you not see it?

pipicom’s picture

@shane-birley

Yes, i have seen it but somehow I forgot about it :)

Thank you for getting back on this.

pipicom’s picture

StatusFileSize
new118.17 KB
new68.62 KB

@marcofernandes
@shane-birley

Would someone help me on my last issue which is still not resolved?

When trying to add a media block via Gutenberg the modal that appears (gutenberg-media-modal.jpg) will not display my custom media types (media-types.png) but only the default ones - ie, the ones that Drupal creates when installing the Media module.

Therefore the extensive list of Media provider modules cannot be used.

Or should i open another issue for this?

Thank you for your time!

shane birley’s picture

@pipicom,

I haven't done a whole lot of research on this yet but I think this is being discussed over here:

I think this is only related to the media system and not directly with Gutenberg's integration. I will do a bit more digging and see what I can find out.

pipicom’s picture

Thank you Shane! Really appreciate this..

I am reading the issue right now and comment here should i come up with something.

pipicom’s picture

So I tried many, many hours but couldnt make this work.

- Tried all possible configurations @ admin/config/content/formats/manage/gutenberg
- Editing the configs (admin/structure/types/manage/myContentType) didnt help either
- Tried to edit the file "GutenbergMediaLibraryUiBuilder.php" in case the media library modal is called in a 'wrong' way
- Installed 'entity_browser' module in order to create a brand new media modal

Long story short, Gutenberg editor cannot "see" custom media types (/admin/content/media) and therefore add them into the body content. Another content type on my project - using CKEditor - worked like a charm, the respective media modal displays the custom media types.

marcofernandes’s picture

Yep, it's not showing custom media types. @pipicom could you please open a bug issue? So we can perhaps close this one and move this issue fixes to the next release.

pipicom’s picture

rwohleb’s picture

While testing gutenberg with different combinations of modules, I found I ended up with a node containing:
<!-- wp:block {"editorskit":{"devices":false,"desktop":true,"tablet":true,"mobile":true,"loggedin":true,"loggedout":true,"acf_visibility":"","acf_field":"","acf_condition":"","acf_value":"","migrated":false}} /-->

This results in a hard error in ReusableBlockFilter when trying to view the node since the ref attribute is missing.

AssertionError: Cannot load the "block_content" entity with NULL ID. in assert() (line 249 of core/lib/Drupal/Core/Entity/EntityStorageBase.php).
assert(, 'Cannot load the "block_content" entity with NULL ID.') (Line: 249)
Drupal\Core\Entity\EntityStorageBase->load(NULL) (Line: 532)
Drupal\Core\Entity\EntityBase::load(NULL) (Line: 41)
Drupal\gutenberg\Plugin\Filter\ReusableBlockFilter->renderBlock(Array)
preg_replace_callback('##', Array, Array) (Line: 27)
Drupal\gutenberg\Plugin\Filter\ReusableBlockFilter->process(...)

Seems like a check needs to be added to make sure the ref property exists before trying to use it.

rwohleb’s picture

StatusFileSize
new714 bytes

  • marcofernandes committed 5020325 on 8.x-1.x authored by rwohleb
    Issue #3097718 by rwohleb, pipicom, marcofernandes: Issue with Reusable...
marcofernandes’s picture

Status: Needs review » Fixed

Applied rwohleb's patch regarding the exception.
Issue with custom media types at https://www.drupal.org/project/gutenberg/issues/3107837

kswamy’s picture

Status: Fixed » Needs work

Hi,
Can you give a tentative date when the current DEV version with above fixes would be released for use in Production? I tried applying the commit but it is not working. Replacing the complete module with current DEV version only works. But I cannot use in Production unless this is released as a stable version.

kswamy’s picture

Status: Needs work » Fixed

Sorry updated status by mistake. Reverting back

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.