[wp-trac] [WordPress Trac] #27938: Restore This Autosave does not work for custom post types that don't support 'revisions'
WordPress Trac
noreply at wordpress.org
Sun Apr 20 13:42:50 UTC 2014
#27938: Restore This Autosave does not work for custom post types that don't
support 'revisions'
--------------------------+-----------------------------
Reporter: bobbingwide | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Revisions | Version: 3.8
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
If you have a custom post type that doesn't support revisions but you
manage to create an autosave which is more recent than the current version
then you get offered the opportunity to restore it, but the restore action
doesn't complete. You end up in an annoying(*) loop.
Expected result: CPT restored to the autosave.
Actual result: Redirected to edit.php for the CPT
Steps to create the problem.
1. Ensure your CPT doesn't support 'revisions'
2. Create a new post and publish it
3. Create an update but don't publish it... just let it autosave
4. When you see the "Draft saved" message just quit
5. Edit the post again.
6. You will be shown the message:
There is an autosave of this post that is more recent than the version
below.
7. Click on the View the autosave link
8. Click on Restore This Autosave button
9. End up at the list of posts for this CPT.
10. go to step 5.
Introduced by: #23497, change 23769
Note:
Fixing this bug by simply reinstating the test on !wp_is_post_autosave(
$revision ) leads to #27244 being applicable.
In my opinion, this follow on problem is preferable to the current
behaviour.
Workaround for developers:
Define 'revisions' support for your CPTs... especially those which support
'editor'.
(*) What's annoying is that you get to see the autosaved version but it's
not just a simple case of copying and pasting the text since the two
versions get merged.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27938>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list