-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Editor: Fix initial edits applied again after saving the post #68273
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @youknowriad!
Size Change: -8 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
Flaky tests detected in 98e8a2b. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12482428622
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick fix! Works for me.
Bug introduced in https://github.com/WordPress/gutenberg/pull/62304/files#r1896745958
Basically the "setupEditor" action is only meant to run once and the addition of the extra dependencies (I'm assuming it was done to please the linter) caused the "initial edits" to be applied again if a post was loaded with initial edits and was saved again.
I think this hook can be rewritten in a different way but for now, I think it's better to just revert to the previous behavior.
Testing Instructions
1- Install Jetpack and enable the "Copy post" writing feature
2- Open the post list
3- Click "copy post"
4- Edit the copied post title
5- Hit save
6- The post title shouldn't revert to the original title and the modified title should be kept.