Problem/Motivation
I was trying to use the Gutenberg Editor in a new D11.1 instance PHP 8.4 and I see the usual "he explicit nullable type" that is appearing on many modules:
Deprecated: _gutenberg_is_gutenberg_enabled(): Implicitly marking parameter $entity as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/gutenberg/gutenberg.module on line 1405
Deprecated: Drupal\gutenberg\MappingFieldsHelper::getMappedFields(): Implicitly marking parameter $template as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/gutenberg/src/MappingFieldsHelper.php on line 264
Deprecated: Drupal\gutenberg\MappingFieldsHelper::getMappedFieldsFromContent(): Implicitly marking parameter $content as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/gutenberg/src/MappingFieldsHelper.php on line 303
Deprecated: Drupal\gutenberg\Parser\BlockParser::parse(): Implicitly marking parameter $filter_callable as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/gutenberg/src/Parser/BlockParser.php on line 89
Steps to reproduce
Install the latest 4.x-dev release of the module, and you'll see the errors, I'm not sure if other versions are affected.
Proposed resolution
All the explicit nullable type in the function parameter
Remaining tasks
Testing.
User interface changes
N/A
API changes
N/A
Data model changes
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | AfterPatch.png | 55.94 KB | riddhi.addweb |
| #11 | Before patch -Extend-Drush-Site-Install-01-20-2026_05_13_PM.png | 623.09 KB | riddhi.addweb |
| #10 | 3536161-10--for-v2.patch | 4.21 KB | leksat |
Issue fork gutenberg-3536161
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
Comment #3
danrodI create a MR that fixes these warnings, I believe the pipieline errors were already there: https://git.drupalcode.org/project/gutenberg/-/merge_requests/223
Feel free to review.
Comment #4
danrodComment #5
danrodComment #6
shubham_pareek_19 commentedComment #8
shubham_pareek_19 commentedComment #9
leksat commentedPatch for v2.14.0
Comment #10
leksat commentedComplete patch for v2.14.0
Comment #11
riddhi.addweb commented@lekast I have verified this patch using SimplyTest.me.
After applying the patch, I was no longer able to reproduce the reported error. The issue appears to be resolved, and the functionality is working as expected.
PFA, I have attached both screenshots for reference.
Comment #12
riddhi.addweb commentedComment #13
codebymikey commentedCan another MR please be created against the 3.x instead, this should make merging a bit easier.
Comment #16
vegardjo commentedHi, made a new MR towards 3.0.x as requested. It's the same commits cherry picked. I can confirm that on both my local 3.0.x and 4.0.x branches this takes the errors away, using php 8.5
Comment #19
codebymikey commentedThanks for all the help!