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

Copy Post: Editor seems to revert title and content changes when saving #40647

Open
pauljacobson opened this issue Dec 15, 2024 · 21 comments
Open
Labels
Customer Report Issues or PRs that were reported via Happiness. aka "Happiness Request", or "User Report" [Feature] Copy a Post [Feature Group] Editor Experience Features related to Gutenberg integration on WordPress.com. [Focus] Compatibility Ensuring our products play well with third-parties [Interaction #] > 10 (Automated) interaction count label for better visibility. Please don't add these manualliy. [Pri] High [Status] Escalated to Product Ambassadors Triaged [Type] Bug When a feature is broken and / or not performing as intended

Comments

@pauljacobson
Copy link
Contributor

Quick summary

There's a confusing user experience issue when copying posts in the WordPress dashboard. When a user copies a post and modifies the title of the copy, the interface appears to revert to the original title, making it seem like the changes weren't saved. However, the changes are actually being saved to a new draft post with a different post ID. This creates confusion because while the URL shows an updated post ID, the visible title doesn't reflect the changes made, leading users to question whether their modifications were preserved.

Here is a video in which I demonstrate the issue using a test WordPress.com site on a free plan:

20241215.Copy.post.UX.issue-optimized.mp4

Steps to reproduce

1.	Open the WordPress dashboard and navigate to the list of posts.
2.	Select a post you want to copy, and note its current URL slug and post ID.
3.	Click the three dots next to the post, and choose Copy Post.
4.	In the post editor, rename the copied post (e.g., change the title to “Some Other Post Copy”).
5.	Save the draft - Observe that the title in the editor sometimes reverts to the original post’s title.
6.	Exit the editor and navigate to the Drafts list - Note that a new draft post is created with an updated post ID, but the title may not reflect the changes you made.
7.	Repeat the process by copying the newly created draft post - Observe similar behavior where the copied post has an updated post ID, but the title and slug behavior remain inconsistent.

What you expected to happen

When copying a post, the copied post with changes that are made to the copy should be preserved in the editor window that the user sees.

What actually happened

When a user copies a post and modifies the title of the copy, the interface appears to revert to the original title, making it seem like the changes weren't saved. However, the changes are actually being saved to a new draft post with a different post ID.

Impact

Most (> 50%)

Available workarounds?

No but the platform is still usable

If the above answer is "Yes...", outline the workaround.

No response

Platform (Simple and/or Atomic)

Simple

Logs or notes

This was reported in 9177618-zen and reproduced in a test site on a free plan.

This issue persists irrespective of browser used. Our customer experienced this issue using Brave, Microsoft Edge and Firefox. I reproduced the issue using Microsoft Edge on macOS 15.2

@pauljacobson pauljacobson added [Feature Group] Editor Experience Features related to Gutenberg integration on WordPress.com. [Type] Bug When a feature is broken and / or not performing as intended Needs triage Ticket needs to be triaged labels Dec 15, 2024
Copy link
Contributor

github-actions bot commented Dec 15, 2024

Support References

This comment is automatically generated. Please do not edit it.

@github-actions github-actions bot added the Customer Report Issues or PRs that were reported via Happiness. aka "Happiness Request", or "User Report" label Dec 15, 2024
@jordesign
Copy link
Contributor

I have a user reporting something similar - Even when they make changes to the post titles in the editor - they revert.
9176633-zd-a8c

@jordesign
Copy link
Contributor

Plenty of examples in this Forum thread too:
https://wordpress.com/forums/topic/bug-copied-posts-cannot-be-edited-saved/?view=all#post-4066835

And it appears it effects the content of the post/page as well. Not only the title.

@supernovia supernovia changed the title Post Copying UI Shows Incorrect Title After Saving, Creating Misleading User Experience Post Copy Editor seems to revert title and content changes when saving Dec 17, 2024
@supernovia supernovia changed the title Post Copy Editor seems to revert title and content changes when saving Copy Post: Editor seems to revert title and content changes when saving Dec 17, 2024
@supernovia
Copy link

📌 REPRODUCTION RESULTS

  • Tested on Simple – Replicated
  • Tested on Atomic – Replicated
  • Replicable outside of Dotcom – Yes, but only after updating Gutenberg

📌 ACTIONS

  • Triaged
  • Pinged Jetpack; we may need to transfer repos as well: p1734447112673469-slack-CDLH4C1UZ

@supernovia supernovia transferred this issue from Automattic/wp-calypso Dec 17, 2024
@supernovia supernovia moved this from In Triage to Triaged in Automattic Prioritization: The One Board ™ Dec 17, 2024
@jeherve jeherve added [Feature] Copy a Post [Focus] Compatibility Ensuring our products play well with third-parties Triaged and removed [Platform] Simple Needs triage Ticket needs to be triaged labels Dec 17, 2024
@jeherve
Copy link
Member

jeherve commented Dec 17, 2024

@youknowriad This seems to have been caused by WordPress/gutenberg#62304, but I don't quite understand the concept of "editor rendering mode" and how it could impact the Copy Post feature. Do you think you could take a look?

For reference, we populate the editor with data from the original post in this class:

add_action( 'wp_insert_post', array( $this, 'update_post_data' ), 10, 3 );

This still works well, and folks can still edit the original content just like before, but upon saving, the new data gets saved properly but the post editor reverts to the original state in which it was open, with the original data, even though in the db we now have updated data.

Do you have any idea about what in that PR could have caused this?

Thank you!

@supernovia
Copy link

Noting I bumped into a case of this that I would not have identified as this bug had I not been aware of it:
9196413-zd-a8c

@aisajib
Copy link

aisajib commented Dec 19, 2024

Also noted here: 9177509-zd-a8c

The user shared these steps:


1. I copy a post (which I have to do to save a lot of time)
2. Try to edit the title (it keeps reverting to the original unedited title)
3. I'm unable to view a lot of images in the editor view and can't view white text if the image background (cover) is missing, for example. 

I'm not sure about the third point above, so I'm asking for more details.

@Mamaduka
Copy link

@jeherve, do you have a minimal code example to reproduce the bug? I'm working on some follow-ups for #62304 and can also look into this.

@jeherve
Copy link
Member

jeherve commented Dec 20, 2024

@Mamaduka You could upload this little plugin to a site using Gutenberg, and then go to the Posts screen and hit "Copy" in the actions links when hovering a published post. In the new post editor that opens, make a few changes to the copied post (change the title for example) and then hit "Save draft". You'll see your changes disappear, even though they were properly saved in the db. Get back to the Posts list, and you'll see the new draft saved properly.

copy-post-test.zip

Let me know if that helps!

@aisajib
Copy link

aisajib commented Dec 20, 2024

Another report here: 9196053-zd-a8c
The user would like to be notified if it's fixed.

@TeniCola
Copy link

Another report in 9204899-zen -- the user would like an update, but we did find a temporary workaround:

After the first revert behavior, refresh the post in the editor (click "Reload" without saving changes, if the brower prompts you) -- the changes should reappear. Then, continue to make new changes without using the “restore a backup” prompt, and the revert behavior should stop moving forward.

There is an internal video of this same behavior and workaround -- p1734902819761479-slack-C02FMH4G8

@CodeAllNightNDay
Copy link

Another case here:
9206635-zen

@youknowriad
Copy link
Contributor

Thanks for the ping @jeherve and sorry for the delay (AFK).

So the PR itself indeed introduced the bug but it was IMO a secondary change that shouldn't have been done in that PR. So I'm pushing a fix here. I would appreciate some testing. WordPress/gutenberg#68273

@radtechgh
Copy link

user copies post, renames and saves draft. Title reverts. 9206492-zen

@galakhyati
Copy link

Another case here: 9235851-zd-a8c

@supernovia
Copy link

9240262-zd-a8c

@github-actions github-actions bot added the [Interaction #] > 10 (Automated) interaction count label for better visibility. Please don't add these manualliy. label Jan 4, 2025
@jp-imagines
Copy link

Also reported here: 9242094-zd-a8c (from duplicate bug report).

@cat-og
Copy link

cat-og commented Jan 5, 2025

Another report here: 9243440-zd-a8c
Simple site, premium plan.

Another workaround that worked for me:

  • Save draft; it will appear to revert the content. Close the post/page, you'll see a prompt that you have unsaved changes. You can confirm that you'd like to leave without saving the changes, then reopen the post or page from the Draft list, the page will open with those initial changes correctly saved (you do have to dismiss the notice about unsaved changes, because clicking the option to restore will revert to the initial copy). From here, the page or post can be managed as expected.

@jeherve
Copy link
Member

jeherve commented Jan 6, 2025

Warning

This should be fixed once the next version of the Gutenberg plugin (20.0) is released and then updated on WordPress.com. The release is currently planned for Thursday, January 9th.
-- https://wordpress.slack.com/archives/C02QB2JS7/p1734981362775539

@filipanoscampos
Copy link

Another case here 9287475-zd-a8c

@SiR-DanieL
Copy link
Member

another report in 9300637-zd-a8c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Customer Report Issues or PRs that were reported via Happiness. aka "Happiness Request", or "User Report" [Feature] Copy a Post [Feature Group] Editor Experience Features related to Gutenberg integration on WordPress.com. [Focus] Compatibility Ensuring our products play well with third-parties [Interaction #] > 10 (Automated) interaction count label for better visibility. Please don't add these manualliy. [Pri] High [Status] Escalated to Product Ambassadors Triaged [Type] Bug When a feature is broken and / or not performing as intended
Projects
Development

No branches or pull requests