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.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3382334_change_guess_method.patch | 623 bytes | jsbalsera |
Issue fork webform_confirmation_file-3382334
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
Comment #2
jsbalseraComment #3
laborouge commentedHello,
The patch in #2 works for me.
Thank you.
Comment #4
james.williamsAgreed; this patch is necessary to work in D10!
Comment #5
awasson commentedThe 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.
Comment #8
fathershawnComment #9
fathershawnFixed in #3435623: Drupal 11 compatibility fixes for webform_confirmation_file
Comment #10
fathershawn