-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Draft child pages: parent is removed when an autosave is performed #10753
Comments
Hey @luminuu, |
I couldn't recreate this issue following the steps above. I could only get it to occur when when the parent page is made to be a draft after being published, not the child page. Steps to recreate the issue:
Unfortunately this is actually the same behavior as the classic editor. One could argue that you should be able to set page hierarchy regardless of publish status, but I think the reasoning behind it is to avoid confusion about visibility of a page. |
I can still reproduce the bug in the current master with the steps described by @luminuu Its important to add content to the page before you publish it. |
I can't reproduce personally. I first thought it was related to the second meta box save (do you have meta boxes on your page), but even with meta boxes, I'm not able to reproduce with the exact steps. Could this be a conflict with another plugin? |
No plugins active. I think it's something with the autosave function.
|
I was able to reproduce without even publishing the page. Yes, so just make some changes and wait for the autosave to trigger. After that you can see in the listing that the parent is not set anymore. |
I imagine it has something to do with this line, and a confusion on
|
Also suspect: Because we're passing This may require one of two changes:
My preference would be the second of these. |
Why do we even include this in the body of the payload? If the parent is already part of the fragment of the request URL, e.g. I still think the REST API should be disregarding the value all the same, if it's intended that the only fields to be updateable on the post are |
Proposed fix at #11513 |
Describe the bug
When publishing a page, that was a draft and also was assigned to have a parent page, the parent is removed when the child page is published.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
When publishing a page that already has a parent page assigned, keep that structure.
Desktop (please complete the following information):
Smartphone (please complete the following information):
not tested
Additional context
The text was updated successfully, but these errors were encountered: