-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fix: Comments and Pingbacks get cleared out when a pattern is edited. #62507
Fix: Comments and Pingbacks get cleared out when a pattern is edited. #62507
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @mlaetitia. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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. |
Size Change: +32 B (0%) Total Size: 1.76 MB
ℹ️ View Unchanged
|
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.
I was able to reproduce the issue, and the PR solves it. The correct comment and ping status is updated.
…#62507) Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org> Co-authored-by: carolinan <poena@git.wordpress.org> Co-authored-by: marcarmengou <marc4@git.wordpress.org> Co-authored-by: marcarmengou <mlaetitia@git.wordpress.org>
I just cherry-picked this PR to the wp/6.6-rc-1 branch to get it included in the next release: 5906113 |
…#62507) Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org> Co-authored-by: carolinan <poena@git.wordpress.org> Co-authored-by: marcarmengou <marc4@git.wordpress.org> Co-authored-by: marcarmengou <mlaetitia@git.wordpress.org>
Fixes: #61827
cc: @mlaetitia
Right now, if meta boxes and custom fields are shown when we save a pattern in a post the comments and pingbacks are disabled. This PR fixes the issue.
The issue happens because when save is pressed and metaboxes/custom fields are enabled we need to trigger a post request saving them and for backwards compatibility comments and pingbacks settings are added in that form.
We were retrieving the comments and pingbacks settings from the current post in the editor. That is wrong the current post may be a pattern that has comments and pingbacks disabled. Instead of using the current post in the editor, we need to retrieve the settings from the post from which meta boxes are being saved, normally the original post opened in the editor.
Testing Instructions
Edit or create a post (Gutenberg)
Make sure you have Custom Fields showing on the editor (hamburguer menu, preferences, advanced , custom fields)
If there's no pattern on that post yet, create one (that syncs across posts)
Make sure the posts and pingbacks are turned on.
Edit the pattern and save it
Head back to the Post editor. If you refresh the page here you'll notice that the comments and pingbacks are turned on ( on trunk they got disabled).