Problem/Motivation
Since I use PHP 8.4.17 I get several Deprecated function warnings. I got it first in Drupal 11.3.13 but thought I might be solved in 11.4.
I found these depreciations:
Deprecated function: _gutenberg_is_gutenberg_enabled(): Implicitly marking parameter $entity as nullable is deprecated, the explicit nullable type must be used instead in include_once() (line 162 of /xxx/drupal/web/core/lib/Drupal/Core/Extension/Extension.php)
Deprecated function: Drupal\gutenberg\BlockProcessor\OEmbedProcessor::__construct(): Implicitly marking parameter $cache_backend as nullable is deprecated, the explicit nullable type must be used instead in include() (line 576 of /xxx/drupal/vendor/composer/ClassLoader.php)
Deprecated function: Drupal\gutenberg\Controller\MediaController::edit(): Implicitly marking parameter $file as nullable is deprecated, the explicit nullable type must be used instead in include() (line 576 of /xxx/drupal/vendor/composer/ClassLoader.php)
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3611549-getMappedFieldsFromContent-nullable-2.patch | 557 bytes | lizuka |
Comments
Comment #2
lizuka commentedThe three deprecations reported here (_gutenberg_is_gutenberg_enabled(), OEmbedProcessor::__construct(), MediaController::edit()) were already fixed in #3536161, committed to 3.0.x on 2026-02-19 (commit 3d26a06d). They still appear on 3.0.6 only because that fix isn't in a tagged release yet — a new 3.0.x release resolves all three.
However, I found one more implicit-nullable spot that #3536161 did not cover and which is still present on current 3.0.x HEAD:
src/MappingFieldsHelper.php:303 → getMappedFieldsFromContent(string $content = NULL, ...)
Attaching a patch adding ?string. Verified it applies against 3.0.6 and 3.0.x HEAD; php -l passes; after it, the module has no remaining implicitly-nullable parameters.