Site logo

Archived topic

No warnings about unsaved changes to blog posts

3 replies · Started by April on August 26, 2018

Viewing posts 1–4 of 4

It's possible this is a WordPress bug but wanted to report it just in case. I've lost a lot of work because of a lack of warning that changes have not been saved.

To reproduce this:
1. Add a new blog post and write some text
2. Save draft
3. Make another change
4. Save another draft (revisions will show 2)
5. Select "Use Sections"
6. Add a section, add text and select "apply" (From the main post page, you'll see the section)
7. Click on "Revisions: Browse" (it will go to the revisions page - it should give a warning first that changes have been made to the page that have not been saved)
8. Select "return to editor"
- The editor will have sections turned off and the entire section that was created is missing. It does not show up in the revisions because the draft wasn't saved before switching pages.

The behavior is the same if you make changes to text (in the main post page), go to revisions, then back to the main page. However, if you click on "Plugins" (instead of revisions), the browser will give a warning "Are you sure you want to leave this page?" (like it recognizes something has not been saved). So, it appears some options are doing a check for changes and others are not.

It's definitely not auto-saving which may be new to this version (not sure).

Hi there,

This is likely happening because WordPress checks the post content editor for changes, but doesn't check metaboxes for changes. The Use Sections and the actual Sections are metaboxes, not regular post content.

I'll log this as an issue and will try to find a fix.

Thanks!

Hey Tom - I found another bug related to this. Revisions don't recall changes made in sections. If I look at the revision history I can see changes but when I go to recall it, it doesn't override what's in the section. This is somewhat problematic.

Revisions only look at the post content, and Sections only add their content to the post content when you save the page.

I think the fix here would be to add the Section content to the post content when drafts are saved. I'll look into that.

This archived topic is closed to new replies.