Multiple errors with PHP 8.1 and webform

Created on 6 August 2022, over 2 years ago
Updated 13 June 2024, 6 months ago

If I activate mime mail as a formatter, the emails are not sent and the sending blocks giving an error. This also happens with the dev version.

ValueError: realpath(): Argument #1 ($path) must not contain any null bytes in realpath() (line 139 of /var/www/vhosts/sitename.com/sitename.com/web/core/lib/Drupal/Core/File/FileSystem.php)
#0 /var/www/vhosts/sitename.com/sitename.com/web/core/lib/Drupal/Core/File/FileSystem.php(139): realpath()
#1 /var/www/vhosts/sitename.com/sitename.com/web/modules/mimemail/src/Utility/MimeMailFormatHelper.php(395): Drupal\Core\File\FileSystem->realpath()
#2 /var/www/vhosts/sitename.com/sitename.com/web/modules/mimemail/src/Utility/MimeMailFormatHelper.php(216): Drupal\mimemail\Utility\MimeMailFormatHelper::mimeMailFile()
#3 /var/www/vhosts/sitename.com/sitename.com/web/modules/mimemail/src/Plugin/Mail/MimeMail.php(206): Drupal\mimemail\Utility\MimeMailFormatHelper::mimeMailHtmlBody()
#4 /var/www/vhosts/sitename.com/sitename.com/web/modules/mimemail/src/Plugin/Mail/MimeMail.php(105): Drupal\mimemail\Plugin\Mail\MimeMail->prepareMessage()
#5 /var/www/vhosts/sitename.com/sitename.com/web/modules/mailsystem/src/Adapter.php(43): Drupal\mimemail\Plugin\Mail\MimeMail->format()
#6 /var/www/vhosts/sitename.com/sitename.com/web/core/lib/Drupal/Core/Mail/MailManager.php(289): Drupal\mailsystem\Adapter->format()
#7 /var/www/vhosts/sitename.com/sitename.com/web/core/lib/Drupal/Core/Mail/MailManager.php(180): Drupal\Core\Mail\MailManager->doMail()
#8 /var/www/vhosts/sitename.com/sitename.com/web/core/lib/Drupal/Core/Render/Renderer.php(564): Drupal\Core\Mail\MailManager->Drupal\Core\Mail\{closure}()
#9 /var/www/vhosts/sitename.com/sitename.com/web/core/lib/Drupal/Core/Mail/MailManager.php(181): Drupal\Core\Render\Renderer->executeInRenderContext()
#10 /var/www/vhosts/sitename.com/sitename.com/web/modules/mailsystem/src/MailsystemManager.php(70): Drupal\Core\Mail\MailManager->mail()
#11 /var/www/vhosts/sitename.com/sitename.com/web/modules/webform/src/Plugin/WebformHandler/EmailWebformHandler.php(1163): Drupal\mailsystem\MailsystemManager->mail()
#12 /var/www/vhosts/sitename.com/sitename.com/web/modules/webform/src/Plugin/WebformHandler/EmailWebformHandler.php(856): Drupal\webform\Plugin\WebformHandler\EmailWebformHandler->sendMessage()
#13 /var/www/vhosts/sitename.com/sitename.com/web/modules/webform/src/Entity/Webform.php(2751): Drupal\webform\Plugin\WebformHandler\EmailWebformHandler->postSave()
#14 /var/www/vhosts/sitename.com/sitename.com/web/modules/webform/src/WebformSubmissionStorage.php(1212): Drupal\webform\Entity\Webform->invokeHandlers()
#15 /var/www/vhosts/sitename.com/sitename.com/web/modules/webform/src/WebformSubmissionStorage.php(1120): Drupal\webform\WebformSubmissionStorage->invokeWebformHandlers()
#16 /var/www/vhosts/sitename.com/sitename.com/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(523): Drupal\webform\WebformSubmissionStorage->doPostSave()
#17 /var/www/vhosts/sitename.com/sitename.com/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(802): Drupal\Core\Entity\EntityStorageBase->save()
#18 /var/www/vhosts/sitename.com/sitename.com/web/modules/webform/src/WebformSubmissionStorage.php(983): Drupal\Core\Entity\Sql\SqlContentEntityStorage->save()
#19 /var/www/vhosts/sitename.com/sitename.com/web/core/lib/Drupal/Core/Entity/EntityBase.php(339): Drupal\webform\WebformSubmissionStorage->save()
#20 /var/www/vhosts/sitename.com/sitename.com/web/modules/webform/src/Entity/WebformSubmission.php(887): Drupal\Core\Entity\EntityBase->save()
#21 /var/www/vhosts/sitename.com/sitename.com/web/modules/webform/src/WebformSubmissionForm.php(1972): Drupal\webform\Entity\WebformSubmission->save()
#22 [internal function]: Drupal\webform\WebformSubmissionForm->save()
#23 /var/www/vhosts/sitename.com/sitename.com/web/core/lib/Drupal/Core/Form/FormSubmitter.php(114): call_user_func_array()
#24 /var/www/vhosts/sitename.com/sitename.com/web/core/lib/Drupal/Core/Form/FormSubmitter.php(52): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers()
#25 /var/www/vhosts/sitename.com/sitename.com/web/core/lib/Drupal/Core/Form/FormBuilder.php(592): Drupal\Core\Form\FormSubmitter->doSubmitForm()
#26 /var/www/vhosts/sitename.com/sitename.com/web/core/lib/Drupal/Core/Form/FormBuilder.php(320): Drupal\Core\Form\FormBuilder->processForm()
#27 /var/www/vhosts/sitename.com/sitename.com/web/core/lib/Drupal/Core/Entity/EntityFormBuilder.php(48): Drupal\Core\Form\FormBuilder->buildForm()
#28 /var/www/vhosts/sitename.com/sitename.com/web/modules/webform/src/Entity/Webform.php(1243): Drupal\Core\Entity\EntityFormBuilder->getForm()
#29 /var/www/vhosts/sitename.com/sitename.com/web/modules/webform/src/Controller/WebformTestController.php(128): Drupal\webform\Entity\Webform->getSubmissionForm()
#30 [internal function]: Drupal\webform\Controller\WebformTestController->testForm()
#31 /var/www/vhosts/sitename.com/sitename.com/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#32 /var/www/vhosts/sitename.com/sitename.com/web/core/lib/Drupal/Core/Render/Renderer.php(564): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#33 /var/www/vhosts/sitename.com/sitename.com/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
#34 /var/www/vhosts/sitename.com/sitename.com/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#35 /var/www/vhosts/sitename.com/sitename.com/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#36 /var/www/vhosts/sitename.com/sitename.com/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#37 /var/www/vhosts/sitename.com/sitename.com/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#38 /var/www/vhosts/sitename.com/sitename.com/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#39 /var/www/vhosts/sitename.com/sitename.com/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#40 /var/www/vhosts/sitename.com/sitename.com/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#41 /var/www/vhosts/sitename.com/sitename.com/web/core/modules/ban/src/BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle()
#42 /var/www/vhosts/sitename.com/sitename.com/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle()
#43 /var/www/vhosts/sitename.com/sitename.com/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#44 /var/www/vhosts/sitename.com/sitename.com/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#45 /var/www/vhosts/sitename.com/sitename.com/web/core/lib/Drupal/Core/DrupalKernel.php(709): Stack\StackedHttpKernel->handle()
#46 /var/www/vhosts/sitename.com/sitename.com/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#47 {main}

🐛 Bug report
Status

Postponed: needs info

Component

Code

Created by

🇮🇹Italy krima

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024