• Resolved Camilo

    (@runonce)


    Hey everyone,

    Everything was working fine with plugin version 0.9.7.6 and WP 3.5 but then I created a new content type and when I tried to manage its field I got a message saying ‘Invalid post type’. After that, all custom content types were gone.

    I checked the database and the posts are still there but they ain’t showing up in the backend neither the frontend.

    Tried disabling and activating the plugin but no luck. I think next I’m gonna try updating to WP 3.5.1 but I just wanted to share this on here. Maybe I’m doing something wrong or this is a real bug.

    https://www.ads-software.com/extend/plugins/custom-content-type-manager/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Camilo

    (@runonce)

    Updated to WP 3.5.1, still same problem.

    Enabled debug mode using define('WP_DEBUG', true); and there are no error messages.

    Plugin Contributor fireproofsocks

    (@fireproofsocks)

    I can’t reproduce this one: I’ve had a couple vague reports of things like this, but I’ve never been able to reproduce it, so I suspect it’s at least partially related to something in your server environment (e.g. text encoding?). If you can outline exact steps that will guarantee this behavior, then I can diagnose and fix it. Unfortunately WP_DEBUG doesn’t do much other than show simple PHP warnings and errors that any decent programmer should have fixed long before releasing a plugin.

    Understand how WP handles post types: WP is totally oblivious to what’s in its database. The only thing that puts a post-type on WP’s radar is declaring it via the register_post_type() function, so if your definition gets corrupted, then your post-types never get declared, and WP has no knowledge of them. There’s a feature request to build out a detection tool/wizard that would help recover from this scenario (or migrate from some other plugin): https://code.google.com/p/wordpress-custom-content-type-manager/issues/detail?id=217 but I haven’t needed it for any projects yet, so it hasn’t been implemented.

    There’s functionality for exporting/importing your post-type definitions (see the CCTM->Tools menu), and it’s a good idea to keep a backup of your definitions since recreating your post-types and fields can take a while.

    As a last resort, check your wp_options database table for the row where option_name=’cctm_data’ and see if you can read/salvage anything there. WP stores option data as a serialized string, which can be problematic and fragile and prone to corruption. Again, I’ve heard of this happening, but I’ve been unable to isolate the issue on any of my dev environments.

    Thread Starter Camilo

    (@runonce)

    These are the settings for cctm_data in wp_options:

    a:8:{
    	s:5:"flash";
    	a:0:{}s:5:"locks";
    	a:0:{}s:14:"post_type_defs";
    	a:0:{}s:17:"custom_field_defs";
    	a:0:{}s:27:"cctm_installation_timestamp";
    	i:1371692093;
    	s:11:"export_info";
    	a:5:{
    		s:5:"title";
    		s:9:"CCTM Site";
    		s:6:"author";
    		s:20:"[email protected]";
    		s:3:"url";
    		s:29:"https://www.demo.com";
    		s:12:"template_url";
    		s:0:"";
    		s:11:"description";
    		s:67:"This site was created in part using the Custom Content Type Manager";
    	}
    	s:21:"cctm_update_timestamp";
    	i:1371692093;
    	s:12:"cctm_version";
    	s:5:"0.9.4";
    }

    I just edited e-mail and url in this post for obvious reasons.

    As far as I can see, it seems the cctm_version is mismatching with the installed version (0.9.7.6).

    Plugin Contributor fireproofsocks

    (@fireproofsocks)

    Your data got corrupted, unfortunately: that’s just default stuff in there. There should be full-blown arrays and data under the post_type_defs and custom_field_defs nodes. So you’ll have to recreate your definitions and custom fields unless you have a backup of your database or of your field defs. Again, I haven’t been able to reproduce this behavior, so I can’t tell you what might have caused this.

    Thread Starter Camilo

    (@runonce)

    Yes, I realized about that when I peeped into a database backup. I replaced it with the data from the backup and everything came back to life.

    Thanks for the support!

    Plugin Contributor fireproofsocks

    (@fireproofsocks)

    Export a backup of your definitions under CCTM –> Tools.

    Support is always appreciated ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Custom content types are gone’ is closed to new replies.