Problem/Motivation

Few constants and functions are deprecated for 10.0 so its time to get rid of it

Proposed resolution

remove the file and usage, make sure no usage left

Remaining tasks

review/commit

User interface changes

no

API changes

no

Data model changes

No

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andypost created an issue. See original summary.

andypost’s picture

andypost’s picture

longwave’s picture

I think this needs something like

    tags:
      - { name: service_collector, tag: mime_type_guesser, call: addMimeTypeGuesser }

adding to file.mime_type.guesser service?

  1. +++ b/core/modules/file/src/Entity/File.php
    @@ -160,13 +159,7 @@ public static function preCreate(EntityStorageInterface $storage, array &$values
           $guesser = \Drupal::service('file.mime_type.guesser');
    ...
    +      $values['filemime'] = $guesser->guessMimeType($values['uri']);
    

    $guesser can be inlined here probably

  2. +++ b/core/modules/responsive_image/responsive_image.module
    @@ -479,10 +478,6 @@ function responsive_image_get_mime_type($image_style_name, $extension) {
       $guesser = \Drupal::service('file.mime_type.guesser.extension');
    ...
       return $guesser->guessMimeType($fake_path);
    

    Same here

Status: Needs review » Needs work

The last submitted patch, 3: 3261265-3.patch, failed testing. View results

andypost’s picture

fix inlining but not sure about tagging because there's no addMimeTypeGuesser() on \Drupal\Core\File\MimeType\MimeTypeGuesser (let's wait for tests)

andypost’s picture

Status: Needs work » Needs review
FileSize
526 bytes
19.91 KB

Yes, that tag is required! Thank you @longwave

longwave’s picture

Status: Needs review » Reviewed & tested by the community

Thank you - looks good if bot agrees.

  • catch committed cf89a29 on 10.0.x
    Issue #3261265 by andypost, longwave: Remove deprecated MimeTypeGuesser...
catch’s picture

Component: cache system » file system
Status: Reviewed & tested by the community » Fixed

Nice to get rid of this, I remember it being a pain to add in the first place.

Committed cf89a29 and pushed to 10.0.x. Thanks!

Status: Fixed » Closed (fixed)

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