"SQLSTATE[HY000]: General error: 1267 Illegal mix of collations" when filtering webforms with non-ASCII characters

Created on 27 August 2024, 3 months ago
Updated 19 September 2024, about 2 months ago

Problem/Motivation

Filtering the webforms with the provided text input produces an error if special character like ä,ö or ü are used.

Steps to reproduce

1. On admin/structure/webform enter a search string with a special character e.g. ö in the provided text input in the "Filter Webforms" section.

2. Hit return or click button "Filter"
3. "The website encountered an unexpected error. Try again later." appears in browser

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (ascii_general_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation '=': SELECT "name", "data" FROM "config" WHERE "collection" = :collection AND "name" IN ( :names__0 ); Array ( [:collection] => [:names__0] => user.role.ö ) in Drupal\Core\Config\DatabaseStorage->readMultiple() (line 111 of core/lib/Drupal/Core/Config/DatabaseStorage.php).
Drupal\Core\Database\StatementWrapperIterator->execute(Array, Array) (Line: 851)
Drupal\Core\Database\Connection->query('SELECT [name], [data] FROM {config} WHERE [collection] = :collection AND [name] IN ( :names__0 )', Array, Array) (Line: 111)
Drupal\Core\Config\DatabaseStorage->readMultiple(Array) (Line: 95)
Drupal\Core\Config\CachedStorage->readMultiple(Array) (Line: 165)
Drupal\Core\Config\ConfigFactory->doLoadMultiple(Array) (Line: 136)
Drupal\Core\Config\ConfigFactory->loadMultiple(Array) (Line: 181)
Drupal\Core\Config\Entity\ConfigEntityStorage->doLoadMultiple(Array) (Line: 312)
Drupal\Core\Entity\EntityStorageBase->loadMultiple(Array) (Line: 262)
Drupal\Core\Entity\EntityStorageBase->load('ö') (Line: 578)
Drupal\webform\WebformEntityListBuilder->getQuery('ö', '', '') (Line: 542)
Drupal\webform\WebformEntityListBuilder->getTotal('ö', '', '') (Line: 234)
Drupal\webform\WebformEntityListBuilder->buildInfo() (Line: 168)
Drupal\webform\WebformEntityListBuilder->render() (Line: 23)
Drupal\Core\Entity\Controller\EntityListController->listing('webform')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->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: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 741)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
🐛 Bug report
Status

Closed: duplicate

Version

6.3

Component

Code

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

Comments & Activities

Production build 0.71.5 2024