\Drupal::entityTypeManager()->getStorage('user_role')->load() can't load non-english string

Created on 18 January 2024, 5 months ago
Updated 26 February 2024, 4 months ago

Problem/Motivation

Steps to reproduce

1. Downlaod latest drupal10 code:
composer create-project drupal/recommended-project my_site_name
2. Fresh install by drush:
drush si --db-url=mysql://root:password@mariadb:3306/d10 --account-pass=abcd1234 --sites-subdir=default -y
3. Use 'devel php' or 'drush ev' or 'custom module' to execute php code

\Drupal::entityTypeManager()->getStorage('user_role')->load("中文");

You will get error:

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.测试 )
🐛 Bug report
Status

Active

Version

11.0 🔥

Component
Database 

Last updated about 10 hours ago

  • Maintained by
  • 🇳🇱Netherlands @daffie
Created by

🇨🇳China lawxen

Live updates comments and jobs are added and updated live.
  • Regression

    It restores functionality that was present in earlier versions.

Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024