- Issue created by @lawxen
- 🇨🇳China lawxen
$role = $this->getEntityStorage('user_role')->load($keys) this Line caused the error,why webform load user role by the searched text?
- 🇨🇳China lawxen
Reproduced Steps:
1. Fresh install Drupal10.2 and Webform 6.2.2
2. Go to /admin/structure/webform
3. Search Chinese like "文字"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 /var/www/html/web/core/lib/Drupal/Core/Config/DatabaseStorage.php).
- 🇨🇳China lawxen
\Drupal::entityTypeManager()->getStorage('user_role')->load("测试");
Just execute this line will got this error too. - Status changed to Closed: duplicate
11 months ago 5:17pm 18 January 2024 - First commit to issue fork.
- 🇫🇮Finland konstara Helsinki
https://www.drupal.org/files/issues/2024-02-26/3415445-cant-load-non-eng... →
For meantime as the core gets updated with solution that eventually closes this, here is a small workaround patch for this particular problem. - 🇧🇪Belgium weseze
I'm also struggling to understand why we are searching for users and roles with the given search string?
What is the use case for this? - Status changed to Active
3 months ago 11:16am 19 September 2024 - 🇺🇸United States jrockowitz Brooklyn, NY
The use case is to allow the keyword search for webforms to search for matching users and roles.
https://git.drupalcode.org/project/webform/-/blob/6.3.x/src/WebformEntit...I'd like to keep this feature and I am okay with removing any invalid character when searching roles.
The patch from #12 seems to be going in the right direction. Can someone please confirm that this is the best approach to filtering out non-english characters.
I am pushing for 📌 Throw an understandable exception when there is an attempt to load config entities with disallowed characters Needs work in Core, so yes, the right thing to do is to filter the input.
- Merge request !555Issue #3415445: Search Chinese in /admin/structure/webform cause error: Illegal mix of collations → (Merged) created by jrockowitz
- Status changed to Needs review
26 days ago 2:19am 23 November 2024 -
jrockowitz →
committed 1f4be598 on 6.3.x
Issue #3415445: Search Chinese in /admin/structure/webform cause error:...
-
jrockowitz →
committed 1f4be598 on 6.3.x
-
liam morland →
committed c2e28db9 on 6.3.x
Issue #3415445: Add spelling exception Fixes issue introduced in...
-
liam morland →
committed c2e28db9 on 6.3.x
-
liam morland →
committed c2e28db9 on 6.x
Issue #3415445: Add spelling exception Fixes issue introduced in...
-
liam morland →
committed c2e28db9 on 6.x
-
jrockowitz →
committed 1f4be598 on 6.x
Issue #3415445: Search Chinese in /admin/structure/webform cause error:...
-
jrockowitz →
committed 1f4be598 on 6.x
Automatically closed - issue fixed for 2 weeks with no activity.