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

Multiple revisions created on save #46130

Open
tnprescott opened this issue Nov 28, 2022 · 3 comments
Open

Multiple revisions created on save #46130

tnprescott opened this issue Nov 28, 2022 · 3 comments
Labels
[Feature] History History, undo, redo, revisions, autosave. [Feature] Meta Boxes A draggable box shown on the post editing screen [Type] Enhancement A suggestion for improvement.

Comments

@tnprescott
Copy link

Description

I'm not sure if this is related to issue #16006, but whenever I try to save an update to page content and an update to a custom field at the same time, it creates two revisions. The first revision shows the page content being changed and all the custom post meta values being removed and the second revision shows all the values being repopulated. It does this for new and published paegs. We're currently on WordPress 5.9.3 and ACF Pro version 5.11.4.

Step-by-step reproduction instructions

  1. Using ACF Pro v5.11.4, create a field group and add a custom field "Header Image Scale" to it. Make it a select box with values of
    noZoom : No Zoom
    one_twentyFive : 1.25x
    one_fifty : 1.5x
    one_seventyFive : 1.75x
    two : 2x
    Make noZoom the default value.
  2. Create a new page and edit the page content as well as change the Header Image Scale to 1.5x.
  3. Save the page and check the revisions. There should be two revisions for the one save where the first one strips out the custom post meta and the second adds it back in.

Screenshots, screen recording, code snippet

ACF Fields Removed
ACF Fields Added

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes, No

@t-hamano t-hamano added Needs Testing Needs further testing to be confirmed. [Feature] History History, undo, redo, revisions, autosave. labels Nov 29, 2022
@ndiego
Copy link
Member

ndiego commented Dec 6, 2022

Hi @tnprescott, this issue was reviewed during the Editor Bug Scrub. We have been able to replicate the situation and it is likely due to the fact that WordPress saves meta boxes separately from post content. Other than making reverting to prior revisions tricky, is this causing any other issues for you?

@ndiego ndiego removed the Needs Testing Needs further testing to be confirmed. label Dec 6, 2022
@tnprescott
Copy link
Author

Hi @ndiego, it's not creating any other major issues as of right now, just not an ideal situation. Do you know of any kind of work around or is it just something to deal with until a fix can be created?

@gziolo gziolo added the [Feature] Meta Boxes A draggable box shown on the post editing screen label Dec 17, 2022
@Mamaduka
Copy link
Member

I believe this is due to the ACF plugin overriding the editor.savePost to enable revisions for post meta. I cannot reproduce this when testing with a custom post-meta plugin.

Sorry for the ping, @lgladdy, but can you confirm this behavior?

As mentioned in #16006, WP won't create a revision by default when only the post meta is changed.

P.S. There's renewed effort to enable revisions for post-meta. See https://core.trac.wordpress.org/ticket/20564.

@jordesign jordesign added the [Type] Enhancement A suggestion for improvement. label Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] History History, undo, redo, revisions, autosave. [Feature] Meta Boxes A draggable box shown on the post editing screen [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

6 participants