After install the module and enable it I can see that there is a link to a configuration page. But that page is giving a WSOD on drupal 8.9.11. The error is like below;
Error: Drupal\file_upload_secure_validator\Form\SettingsForm->getConfigurationAsCsvString() fonksiyonunda Undefined class constant 'NO_HEADERS_KEY' (/home/kerataif/public_html/turksat.com/web/modules/contrib/file_upload_secure_validator/src/Form/SettingsForm.php dosyasının 99 satırında)
#0 /home/kerataif/public_html/turksat.com/web/modules/contrib/file_upload_secure_validator/src/Form/SettingsForm.php(73): Drupal\file_upload_secure_validator\Form\SettingsForm->getConfigurationAsCsvString()
#1 [internal function]: Drupal\file_upload_secure_validator\Form\SettingsForm->buildForm(Array, Object(Drupal\Core\Form\FormState))
#2 /home/kerataif/public_html/turksat.com/web/core/lib/Drupal/Core/Form/FormBuilder.php(532): call_user_func_array(Array, Array)
#3 /home/kerataif/public_html/turksat.com/web/core/lib/Drupal/Core/Form/FormBuilder.php(278): Drupal\Core\Form\FormBuilder->retrieveForm('file-upload-sec...', Object(Drupal\Core\Form\FormState))
#4 /home/kerataif/public_html/turksat.com/web/core/lib/Drupal/Core/Controller/FormController.php(91): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\file_upload_secure_validator\Form\SettingsForm), Object(Drupal\Core\Form\FormState))
#5 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#6 /home/kerataif/public_html/turksat.com/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#7 /home/kerataif/public_html/turksat.com/web/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#8 /home/kerataif/public_html/turksat.com/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#9 /home/kerataif/public_html/turksat.com/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#10 /home/kerataif/public_html/turksat.com/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#11 /home/kerataif/public_html/turksat.com/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#12 /home/kerataif/public_html/turksat.com/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#13 /home/kerataif/public_html/turksat.com/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#14 /home/kerataif/public_html/turksat.com/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#15 /home/kerataif/public_html/turksat.com/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /home/kerataif/public_html/turksat.com/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 /home/kerataif/public_html/turksat.com/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 /home/kerataif/public_html/turksat.com/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 /home/kerataif/public_html/turksat.com/web/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /home/kerataif/public_html/turksat.com/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#21 {main}
The module page says that there is no setting or configuration. So is this a leftover page?
Comments
Comment #2
stefanos.petrakisI will need some more info to look further into this.
I cannot reproduce this on my local dev and the source of 8.9.11 contains the proper class (Symfony\Component\Serializer\Encoder\CsvEncoder where the constant can be found.
Is this a composer-managed project? Has the source been modified? Can you check if you can find the required dependency of CsvEncoder under the vendor folder? (just guessing here)
Comment #3
yogeshmpawarHi @stefanos.petrakis
I am facing same problem with my drupal site which having the version 8.9.10.
See the difference between CSVEncoder -
for drupal 8.8.x & 8.9.x - https://api.drupal.org/api/drupal/vendor%21symfony%21serializer%21Encode...
for drupal 9.0.x -
https://api.drupal.org/api/drupal/vendor%21symfony%21serializer%21Encode...
so basically "NO_HEADERS_KEY" this constant is added in drupal 9.0.x onwords & so your module will give error for all drupal 8.8.x & 8.9.x sites.
https://api.drupal.org/api/drupal/vendor%21symfony%21serializer%21Encode...
Comment #4
yogeshmpawarHi @stefanos.petrakis,
Can you please review this patch & this patch will work for drupal 8.8.x & 8.9.x sites.
Comment #5
stefanos.petrakisI would like to keep this option in place for newer versions.
It would be a good idea to provide backwards compatibility.
Could you update the patch to cover both cases using something like this:
if (defined('CsvEncoder::NO_HEADERS_KEY')) { ...Comment #7
stefanos.petrakisSo, there is a working patch here
https://git.drupalcode.org/project/file_upload_secure_validator/-/merge_...
that should solve the reported problem.
I ask kindly the people involved in this thread to test and confirm that this solves their issues.
Comment #9
stefanos.petrakisI moved this in, I got the feeling this is an urgent "hot" fix for some people.