Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V13 RC: Document types throw an error when inserting a block capable editor #15615

Merged

Conversation

iOvergaard
Copy link
Contributor

@iOvergaard iOvergaard commented Jan 19, 2024

Description

Fixes #15588

A minor regression was introduced with #15063 where the editorState held an actual id when used in the Document Type Editor as well, but since this is not real content, the request to GetEmptyByKeys would throw an error whenever you insert any block capable editor on a document type (e.g. rich text editor, block list, and block grid).

This has been fixed by checking if we are inside a content editor context or editing a document type by checking for the presence of the property contentTypeKey on editorState.getCurrent(), which should only be present when editing actual content, which has an actual id representing content in the database.

…urrentPageId if we are not in an editor mode

we detect the editor mode by checking for `contentTypeKey` which only exists on content contexts
Copy link
Member

@leekelleher leekelleher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it out, works as expected for me. 👍

@iOvergaard iOvergaard merged commit f3ed935 into release/13.1.0 Jan 22, 2024
14 checks passed
@iOvergaard iOvergaard deleted the v13/bugfix/blockeditormodel-getemptybykeys branch January 22, 2024 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants