#53813 closed defect (bug) (fixed)
Do not provide initial_edits for properties that are not supported by the current post type.
Reported by: | youknowriad | Owned by: | audrasjb |
---|---|---|---|
Milestone: | 5.9 | Priority: | normal |
Severity: | normal | Version: | 5.8 |
Component: | Editor | Keywords: | good-first-bug has-patch commit |
Focuses: | Cc: |
Description
I noticed that edit-form-blocks.php (block editor initialization) always provides "title", "content" and "excerpt" initial edits in the initializeEditor
call even though these properties might not be supported by the current post type being edited.
This creates a subtle bug in the post editor where as soon as you open a "new post", the editor considers the content "dirty", meaning changes are applied and you can't "leave" the editor without having the "unsaved changes" notice.
I think we should consider updating the $initial_edits variable declaration to only add the properties that are supported by the current CPT.
Attachments (3)
Change History (22)
This ticket was mentioned in Slack in #core by amustaque97. View the logs.
3 years ago
This ticket was mentioned in PR #1743 on WordPress/wordpress-develop by hectorfarahani.
3 years ago
#2
- Keywords has-patch added
#3
@
3 years ago
My first patch! I had to wait for Github checks. The new diff is attached after passing all checks.
This ticket was mentioned in Slack in #core-editor by h71. View the logs.
3 years ago
#5
@
3 years ago
- Owner set to audrasjb
- Status changed from new to reviewing
Self-assigning for review.
This ticket was mentioned in PR #1927 on WordPress/wordpress-develop by audrasjb.
3 years ago
#8
Trac ticket: https://core.trac.wordpress.org/ticket/53813
#13
@
3 years ago
Just want to surface my comment on the PR here - https://github.com/WordPress/wordpress-develop/pull/1743#discussion_r754031590
Looks like this fix caused a bug.
I've created a PR to fix the problem - https://github.com/WordPress/wordpress-develop/pull/1929
This ticket was mentioned in PR #1929 on WordPress/wordpress-develop by talldan.
3 years ago
#14
Trac ticket: https://core.trac.wordpress.org/ticket/53813
This PR fixes an issue with the already submitted patch for that trac ticket.
See https://github.com/WordPress/wordpress-develop/pull/1743#discussion_r754031590 for details.
SergeyBiryukov commented on PR #1929:
3 years ago
#18
Sorry, didn't know you were around too 😅
Trac ticket: https://core.trac.wordpress.org/attachment/ticket/53813