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

Issue fork gutenberg-3536161

Command icon 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

danrod created an issue. See original summary.

danrod’s picture

I 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.

danrod’s picture

Assigned: danrod » Unassigned
danrod’s picture

Status: Active » Needs review
shubham_pareek_19’s picture

Assigned: Unassigned » shubham_pareek_19

ts.ag made their first commit to this issue’s fork.

shubham_pareek_19’s picture

Assigned: shubham_pareek_19 » Unassigned
leksat’s picture

StatusFileSize
new1.03 KB

Patch for v2.14.0

leksat’s picture

StatusFileSize
new4.21 KB

Complete patch for v2.14.0

riddhi.addweb’s picture

@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.

riddhi.addweb’s picture

Status: Needs review » Reviewed & tested by the community
codebymikey’s picture

Version: 4.0.x-dev » 3.0.x-dev
Status: Reviewed & tested by the community » Needs work

Can another MR please be created against the 3.x instead, this should make merging a bit easier.

vegardjo made their first commit to this issue’s fork.

vegardjo’s picture

Status: Needs work » Needs review

Hi, 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

  • codebymikey committed 3d26a06d on 3.0.x authored by vegardjo
    fix: #3536161 [PHP 8.4] Address deprecation warnings
    
    By: danrod
    By: ts....

  • codebymikey committed 2bd11ade on 4.0.x authored by danrod
    fix: #3536161 [PHP 8.4] Address deprecation warnings
    
    By: danrod
    By: ts....
codebymikey’s picture

Version: 3.0.x-dev » 4.0.x-dev
Status: Needs review » Fixed

Thanks for all the help!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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