- Issue created by @loze
- First commit to issue fork.
- Status changed to Needs review
12 months ago 11:22am 22 May 2024 - π΅πΉPortugal marcofernandes
@loze I couldn't replicate but I did find some test code that might have caused that error.
Could you provide more details about your site install? Drupal core version, installed modules/themes? -
marcofernandes β
committed 38fe76af on 3.x
Issue #3448930: Remove test code. Cleanup.
-
marcofernandes β
committed 38fe76af on 3.x
- πΊπΈUnited States loze Los Angeles
I'm still seeing this on my end.
Im using Drupal: 10.2.6, Php 8.2.0
With the latest dev 3.x version of guttenbergThe error happens on the 2 different block types I was testing on, both the default "basic block" type and a custom block type that's just an entityreference and title.
both block types only have the default view mode, the default view mode is selected in the gutenberg edit widget when adding the block.
The block is created in guttenberg w/o any errors, but I get the errors when viewing it on the front end.
It's a fairly straitforward set up. My Blocks work fine when I place them normally.
Digging in little further I see that in contentBockProcessor.php the only key in the #configuration section of the block render array is 'provider'
block_content_theme_suggestions_block_alter() expects the 'view_mode' key to be present (even if its empty)It does feel like there should be other config variables here too though, for instance the block title, no?
Nonetheless, this patch adds the view mode and makes hte error go away.
-
marcofernandes β
committed 582c130e on 3.x
Issue #3448930 by marcofernandes, loze: Add view_mode to build array
-
marcofernandes β
committed 582c130e on 3.x
- π΅πΉPortugal marcofernandes
I couldn't replicate but you're right about the 'view_mode' index usage at block_content_theme_suggestions_block_alter().
I don't think there's a title property for content blocks but a description (the reference is info). But I think it's irrelevant - it will be always the same in case of block instances created by Gutenberg.
Let's just add your patch. - πΊπΈUnited States loze Los Angeles
Thanks for adding this. There is another instances where this is occurring and Im getting the same error. I think it also needs to go into blocksController.php.
These two patches cleared it up for me.
- πΊπΈUnited States loze Los Angeles
sorry wrong patch, this is the right one.
- Status changed to Fixed
12 months ago 1:16pm 27 May 2024 - π΅πΉPortugal marcofernandes
It seems it was already added here π : https://git.drupalcode.org/project/gutenberg/-/merge_requests/144/diffs#...
-
marcofernandes β
committed 582c130e on 3.0.x
Issue #3448930 by marcofernandes, loze: Add view_mode to build array
-
marcofernandes β
committed 582c130e on 3.0.x
-
marcofernandes β
committed 38fe76af on 3.0.x
Issue #3448930: Remove test code. Cleanup.
-
marcofernandes β
committed 38fe76af on 3.0.x
Automatically closed - issue fixed for 2 weeks with no activity.