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
Comments
Comment #2
leo liao commentedComment #3
leo liao commentedComment #4
leo liao commentedComment #5
leo liao commentedComment #6
cilefen commentedCan 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?
Comment #7
leo liao commentedWhen 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.
Comment #8
leo liao commentedComment #9
leo liao commentedI found two related issues.
https://www.drupal.org/project/drupal/issues/3415478
https://www.drupal.org/project/webform/issues/3415445
Comment #10
leo liao commentedComment #11
bingol@ciandt.com commentedComment #12
liam morlandPlease put the patch into an issue fork and merge request.
Comment #14
jrockowitz commentedWe 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 thaniconv('UTF-8', 'ASCII//TRANSLIT', $keys)and both statement accomplish similar goals.Comment #17
jrockowitz commented