Problem/Motivation

During add empty content when you have gutenberg and hook_event_dispatcher module sometimes appear:

Warning: Trying to access array offset on value of type null in gutenberg_form_alter() (line 281 of modules/contrib/gutenberg/gutenberg.module).
gutenberg_form_alter(Array, Object, 'node_type_add_form') (Line: 562)
Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'node_type_add_form') (Line: 114)
Drupal\hook_event_dispatcher\HookEventDispatcherModuleHandler->alter(Array, Array, Object, 'node_type_add_form') (Line: 838)

Comments

Pawelgorski87 created an issue. See original summary.

pawelgorski87’s picture

StatusFileSize
new672 bytes
pawelgorski87’s picture

Issue summary: View changes
szeidler’s picture

I can confirm the problem. It has been introduced in #3328033: Add a UI for disabling custom blocks per content type . It was mentioned there but didn't seem to have gotten fixed.

I would probably move the whole foreach into the prior if condition if ($custom_settings) { and change that one to if (isset($custom_settings['categories'])) {

What do you think?

nishchit.dayal’s picture

StatusFileSize
new552 bytes

Unable to apply the #2 patch. Adding updated patch.

nishchit.dayal’s picture

StatusFileSize
new539 bytes
hkirsman’s picture

#6 Works for us

kaustab_roy’s picture

Status: Active » Needs review
kris77’s picture

#6 works form me too. Thanks @nishchit.dayal

spoof’s picture

#6 works perfectly here too. Thanks !

tyler36’s picture

StatusFileSize
new41.62 KB
new21.57 KB

Confirmed patch #6 fixes issue on Drupal 10.1.0.

## Test

1. Install and enable gutenberg module.
2. Visit "Basic Page edit": /admin/structure/types/manage/page

3. Apply patch #6.
4. Refresh page (cache clear is _not_ required)

tyler36’s picture

Status: Needs review » Reviewed & tested by the community
joseph.olstad’s picture

Thanks , we needed the patch from #6 also. Same exact error as illustrated in #11 (see screenshots).

We're using PHP 8.1 , more and more people will need/want the above patch as we move forward people will be running PHP 8.2 and PHP 8.1 , rather than PHP 8.0.

PHP 8.2 is faster, consumes less memory than PHP 8.1
PHP 8.1 is faster, consumes less memory than PHP 8.0

joseph.olstad’s picture

Issue tags: +PHP 8.1
toddwalden’s picture

Hey all, I'm still seeing a page rendering issue after installing Gutenberg in Drupal 10, whether I use the patch or not (also having the same issue if I try installing the previous version of Gutenberg).

The chrome console shows two errors:

Uncaught SyntaxError: Unexpected token ':'

Uncaught TypeError: Cannot read properties of undefined (reading 'attach')

UPDATE:

Looks like it might not be related Gutenberg specifically, but to Drupal's js aggregation: https://www.drupal.org/project/gutenberg/issues/3372307

szeidler’s picture

Version: 8.x-2.7 » 8.x-2.x-dev
Status: Reviewed & tested by the community » Fixed

This has landed on 8.x-2.x-dev. Thanks for your contributions.

Status: Fixed » Closed (fixed)

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