The core of drupal is 10.2.3 and webform is 6.2.2.

Add the following content to the source, then go back to Elements and click the "Edit" button of test_field_1, and then directly click the "Save" button in the pop-up window on the right.
You will see the error message:

Item format custom HTML is not valid.
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] => core.date_format.Y年 )
4 errors have been found: Item format custom HTMLItem format custom TextItems format custom HTMLItems format custom Text
modi:
  '#type': wizard_page
  '#title': modi
  '#next_button_label': Next
  test_field_1:
    '#type': date
    '#title': test_field_1
    '#datepicker': true
    '#date_date_format': Y年
preview:
  '#type': wizard_page
  '#title': preview
  '#prev_button_label': PreView
  test_field_2:
    '#type': computed_token
    '#title': test_field_2
    '#template': '<span>[webform_submission:values:test_field_1]</span>'
actions:
  '#type': webform_actions
  '#title': 'Submit button(s)'
  '#submit__label': Save

Issue fork webform-3443934

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

leo liao created an issue. See original summary.

leo liao’s picture

StatusFileSize
new5.24 KB
leo liao’s picture

StatusFileSize
new107.56 KB
leo liao’s picture

Issue summary: View changes
leo liao’s picture

Issue summary: View changes
cilefen’s picture

Status: Active » Postponed (maintainer needs more info)

Can you confirm that the date format machine name Y年 is the cause? If so, how did you enter Y年 as a date format machine name?

leo liao’s picture

When investigating webform/src/Plugin/WebformElement/DateBase.php:197, we found that it directly uses DateFormat::load('Y年') for query. In drupal, the format of id has requirements that do not allow the use of '年'. This kind of character.

leo liao’s picture

Status: Postponed (maintainer needs more info) » Needs work
leo liao’s picture

StatusFileSize
new552 bytes
bingol@ciandt.com’s picture

StatusFileSize
new556 bytes
liam morland’s picture

Version: 6.2.x-dev » 6.3.x-dev

Please put the patch into an issue fork and merge request.

jrockowitz made their first commit to this issue’s fork.

jrockowitz’s picture

Status: Needs work » Needs review

We need to standardize our approach to special character in config entity id.

The MR also updates #3415478: \Drupal::entityTypeManager()->getStorage('user_role')->load() can't load non-english string to use mb_convert_encoding($keys, 'ASCII', 'UTF-8') which feels easier to understand than iconv('UTF-8', 'ASCII//TRANSLIT', $keys) and both statement accomplish similar goals.

  • jrockowitz committed 30a15a9b on 6.3.x
    Issue #3443934: Item format custom HTML is not valid
    
jrockowitz’s picture

Status: Needs review » Fixed

  • jrockowitz committed 30a15a9b on 6.x
    Issue #3443934: Item format custom HTML is not valid
    

  • liam morland committed b55879c6 on 6.3.x
    Issue #3443934: Remove obsolete spelling exception
    
    Obsolete since...

  • liam morland committed b55879c6 on 6.x
    Issue #3443934: Remove obsolete spelling exception
    
    Obsolete since...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.