I loaded up the module on a Drupal 9.4.5 system with PHP 8.1 and received the following when I went to create an article and went to add a media image.

Deprecated function: explode(): Passing null to parameter #2 ($string) of type string is deprecated in Drupal\gutenberg\MediaTypeGuesser->guess() (line 65 of /home/sitename/public_html/modules/contrib/gutenberg/src/MediaTypeGuesser.php).:

CommentFileSizeAuthor
#2 deprecated-explode-3301695-2.patch804 bytessiddhraj

Comments

Christopher Riley created an issue. See original summary.

siddhraj’s picture

StatusFileSize
new804 bytes

Hello Please Review this patch

avpaderno’s picture

Title: Deprecated function: explode() » explode(): Passing null to parameter #2 ($string) of type string is deprecated in Drupal\gutenberg\MediaTypeGuesser::guess()
Status: Active » Needs review
Issue tags: +PHP 8.1

  • szeidler committed 61362bf on 8.x-2.x
    Issue #3301695 by Siddhraj, Christopher Riley, apaderno:  explode():...
szeidler’s picture

Status: Needs review » Fixed

Thanks for the contribution. The patch is required if there is a media type, that does not have a source field that is a file field and therefore has file extensions specified. A common example would be "Remote Media/OEmbed". The patch resolves this.

It's part of the most recent dev release now.

Status: Fixed » Closed (fixed)

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