Skip Navigation

[Resolved] Revisions no longer displaying for any CPTs

This support ticket is created 7 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 5 replies, has 2 voices.

Last updated by Beda 7 years, 2 months ago.

Assisted by: Beda.

Author
Posts
#572743

I am trying to:
Show revisions for my long-existing custom post types (~2.5 years.)

Link to a page where the issue can be seen:
N/A

I expected to see:
Revisions: as in normal WP Posts page

Instead, I got:
Even with the Revisions checkbox checked in the "Sections to display when editing Events" is checked in Edit Post Type page, there are no revisions showing in the Edit page of my CPTs. And, even if I create a new post for a CPT, and make a few revisions, the Revisions does not show up in the Screen Options or at the bottom of the post.

#572833

I have revisions on my Custom Post Types after I activate it in Toolset > Post Types > my_post_type > Edit > Sections to Display when editing... > Revisions.

I need to save a post twice, by the third time the revisions start to appear in the "Publish" meta box on your right hand on the screen.

I assume this is an issue with either the install itself (maybe revisions are disabled site-wide?) or, a conflict with another Software.

Can you try to disable all plugins, and use a native WordPress Theme?
Please perform a backup before you proceed with this.

If then the issue is not solved, please also make sure that the wp-config.php does not disable revisions.

As a last resort, if this all does not help, I will need a site's snapshot to assist you as fast and effective as possible.
https://toolset.com/faq/provide-supporters-copy-site/

I can then deploy your site locally and check what's wrong.

Thank you

#573132

Beda -

Thanks for the reply.

I have tried deactivating ALL other plugins except Types, Views, Access, Layouts - plus changed theme to 2016. No change.

This is not a site-wide setting as my wp-config has revisions = 10.

Someone today suggested to me that it sounds like the custom post type is not being correctly registered with WP. After a test I just did 5 minutes ago, there appears to be a problem there. I don't understand how that can happen though. By default, WP only looks at the Title and standard Editor fields for changes. That's why a CPT must be properly registered for the revisions to work correctly. Of course, if a CPT uses only a title and editor field (and no custom fields) the revisions will work fine. So, what I just tested was, I simply added an 's' to the end of my CPT post's Title field and voila! The Revisions checkbox immediately shows up in Screen Options dropdown and the actual revisions now show up at the bottom of the post. - By the way, you stated that the revisions will show up in the meta boxes on the right. That is not where revisions appear in Types' CPTs; they appear at the bottom of the post.

So, I will next try forcing an action for saving posts and see if registering the CPT with the proper "custom fields" set in args() makes a difference. But, I would appreciate you or someone at Toolset Support take a look into this.

Thanks,
Jeff Safire
----------------

#573574
Revisions.png

So, what I just tested was, I simply added an 's' to the end of my CPT post's Title

I assume you mean the Post (Single Post) Title, not the Post Type name, right?
Hence, it is expected that if you edit the Post title or Post Body, a revision will be created.

So far so good.
This is what we tested because it was reported as broken. It seems to work fine also on your end?

By the way, you stated that the revisions will show up in the meta boxes on the right. That is not where revisions appear in Types' CPTs; they appear at the bottom of the post.

Probably you reordered the Edit Screen at some point and WordPress remembers your settings.
Please see the attached ScreenShot on how the default native setup looks.

I marked in Red where I see the revisions.

So, I will next try forcing an action for saving posts and see if registering the CPT with the proper "custom fields" set in args() makes a difference.

I am not sure what you mean. You do not need to have Custom Fields for revisions.
Custom Fields cannot have revisions, as far I am informed. Only the Native Post Data can have revisions.

#573943

Beda -

Thanks for the reply.
This is not so complicated. This all used to work just fine until a recent update of Types (I am not sure exactly when.)

A CPT must be registered for WP to handle it properly. In that registering function (add_post_type_support) the "revisions" feature must be included in the $supports array passed to the function. This allows WP to store revisions of the single posts of a CPT. But, this is not working for any of my custom post types. The revisions feature only works if I make a change to the title of the single post. That is not how it used to work. A new revision should be stored every time a change is made to any field - even a custom field. None of my CPTs include the WP Editor because I use the Types WYSIWYG fields instead. Still, if I make a change to that field, it should generate a new revision, but it is not working that way.

Please have another look at this.

Thanks,
Jeff

#574025

A CPT must be registered for WP to handle it properly. In that registering function (add_post_type_support) the "revisions" feature must be included in the $supports array passed to the function. This allows WP to store revisions of the single posts of a CPT

Correct. This is done in the Toolset > Post Types > your_post_type > Edit > Options.

A new revision should be stored every time a change is made to any field - even a custom field.

No, I cannot confirm this.
Revisions are on Post native data; Fields were never included there.

I am not sure how you achieved to have revisions in our Custom Fields, this was never supported.
I also double checked this with the DEV Team.

Now, since you mention this stopped working just recently, I suggest we do this:

1. Please send me a Site's Snapshot of your Website where this issue happens.
2. Please let me know what version of Toolset I need to run to have it back working, as you mentioned eaerlier.
It must not be the exact version number; I can work with "something before xy."
3. I will make tests to see if:
- I will have revisions
- What happens during the update
- How to solve the problem.

We will find the bottom to this issue.

Thank you!