Skip to content

Cannot save "Make template part" when the template part name is in multibyte language #38160

@waviaei

Description

@waviaei

Description

In the new (theme) editor, one can save block(s) as template parts, accessed via the "three-dots" menu. It seems you cannot save it if multibyte language is used as template part name.

Looking at the console error, there seem to be something with creating slug from the input text? and JS has stopped there, resulting in "saving" to not finish.

I tried same thing with English template name, and it worked.

Note: I have not tested in other multibyte language such as CK, but looking at the nature of the issue, I am suspecting it is multi-byte related.

Step-by-step reproduction instructions

  1. Pick something and click the three-dots menu (Here, I made a tweak at Query Loop for Home template)
  2. Click "Make template part"
  3. Enter multibyte language e.g. 私のテンプレートパーツのテスト
  4. Click "Create"

You should see that Create button do the animation to save, but never seem to end. If you keep open the dev tool console tab, you should be able to see `Cannot read properties of undefined (reading 'slug) error.

スクリーンショット 2022-01-23 17 30 52

(here you seeing the error three times, because I attempted three times)

Repeat above with non-multibyte language and you won't encounter the error.

Screenshots, screen recording, code snippet

No response

Environment info

  • WordPress 5.9-RC3-52619 (using beta plugin)
  • Theme: I checked with Automattic's Blockbase (v 2.0.15) and Livro (1.0.1) from .org. I could not activate twentytwenty two, as I got "It is not compatible with this version of WordPress, please update".

Gutenberg is deactivated.

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

Labels

[Feature] Site EditorRelated to the overarching Site Editor (formerly "full site editing")[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions