Error: Call to undefined function Drupal\upload_image_changer\mime_content_type()

Created on 17 March 2023, over 1 year ago

Problem/Motivation

When uploading image, the upload suddenly stuck and does not upload.
When checking the log this log is shown:

Error: Call to undefined function Drupal\upload_image_changer\mime_content_type() in Drupal\upload_image_changer\UploadImageChangerHookImplementations->applyImageStyleOnUploadValidatorCallback() (line 118 of /home/test/web/modules/contrib/upload_image_changer/src/UploadImageChangerHookImplementations.php)

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇲🇾Malaysia muaz91 MY

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @muaz91
  • @muaz91 opened merge request.
  • 🇲🇾Malaysia muaz91 MY

    I sorry I am not sure how to make a patch, for anyone wanting to fix:
    edit this file src/UploadImageChangerHookImplementations.php

    change this:
    $new_mime = mime_content_type($derived_uri);
    to this:
    $new_mime = \Drupal::service('file.mime_type.guesser')->guess($derived_uri);

  • @muaz91 opened merge request.
  • Status changed to Needs review over 1 year ago
Production build 0.71.5 2024