Problem/Motivation

Module errors when trying to guess the mime type of the file in D10, due to a change in the ExtensionMimeTypeGuesser class in Drupal core.

Error: Call to undefined method Drupal\Core\ProxyClass\File\MimeType\ExtensionMimeTypeGuesser::guess() in Drupal\webform_confirmation_file\Plugin\WebformHandler\ConfirmationFileWebformHandler->getMimeType() (line 179 of modules/contrib/webform_confirmation_file/src/Plugin/WebformHandler/ConfirmationFileWebformHandler.php).

Drupal\webform_confirmation_file\Plugin\WebformHandler\ConfirmationFileWebformHandler->confirmForm(Array, Object, Object) (Line: 2765)
Drupal\webform\Entity\Webform->invokeHandlers('confirmForm', Array, Object, Object) (Line: 1926)
Drupal\webform\WebformSubmissionForm->confirmForm(Array, Object)
call_user_func_array(Array, Array) (Line: 114)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 52)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 597)
Drupal\Core\Form\FormBuilder->processForm('webform_submission_ai_whitepaper_form_add_form', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 48)
Drupal\Core\Entity\EntityFormBuilder->getForm(Object, 'add') (Line: 1257)
Drupal\webform\Entity\Webform->getSubmissionForm() (Line: 77)
Drupal\webform\Controller\WebformEntityController->addForm(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 163)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 692)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

Submit a form with a confirm file in a D10 site.

CommentFileSizeAuthor
#2 3382334_change_guess_method.patch623 bytesjsbalsera
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

jsbalsera created an issue. See original summary.

jsbalsera’s picture

StatusFileSize
new623 bytes
laborouge’s picture

Hello,
The patch in #2 works for me.
Thank you.

james.williams’s picture

Status: Active » Reviewed & tested by the community

Agreed; this patch is necessary to work in D10!

awasson’s picture

Priority: Major » Critical

The patch in #2 works and there is no reason why it shouldn't be applied and released.

I changed this to "critical" because without this patch there is no way to get to the webform handler if a webform confirmation file handler has been attached to the form.

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

  • fathershawn committed e4dc7c08 on 8.x-1.x
    fix: #3382334 Module errors when trying to guess the mime type of the...
fathershawn’s picture

fathershawn’s picture

fathershawn’s picture

Status: Reviewed & tested by the community » Fixed

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.