WordPress.org

Forums

Custom Content Type Manager
Possible Issue with WP 3.8 & CCTM (23 posts)

  1. Mike
    Member
    Posted 1 year ago #

    Hi,

    After updating to WP 3.8, links to CCTM (v 0.9.7.11) custom content type posts are throwing a 404 error.

    the failing URLS are in the form:

    http://site.com/your_post_type/your-title/

    I was able restore the site from backups, confirm that it was working as expected, updated from WP 3.6 to 3.8, and confirmed that the URLs stopped working.

    Also, I re-saved my permalink settings for good measure, with no change.

    FYI, permalinks are set to:

    http://site.com/sample-post/

    Any suggestions would be appreciated.

    Thanks!

    Mike

    http://wordpress.org/plugins/custom-content-type-manager/

  2. Mike
    Member
    Posted 1 year ago #

    My apologies. Looks like this is the same problem discussed here:

    http://wordpress.org/support/topic/custom-content-type-404-after-37-upgrade?replies=28

  3. Mike
    Member
    Posted 1 year ago #

    I was able to circumvent this problem with a simple hack that I added to my functions.php file.

    PROS is the name of my custom content type.

    To use this hack on your site, you'll need to change every occurrence of PROS in the code below to the name of your custom content type.

    /* Populate the query variable
    ------------------------------------------------------------ */
    function pros_add_rewrite_rules($aRules) {
        $aNewRules = array('pros/([^/]+)/?$' => 'index.php?post_type=pros&name=$matches[1]');
        $aRules = $aNewRules + $aRules;
        return $aRules;
    }
    
    // hook add_rewrite_rules function into rewrite_rules_array
    //
    if ( !is_admin() ) {
    	add_filter('rewrite_rules_array', 'pros_add_rewrite_rules');
    	}

    This is a stupid little hack. Your mileage may vary. (You'll want to remove it when the plugin is updated.)

  4. fireproofsocks
    Member
    Plugin Author

    Posted 1 year ago #

    I need to get this updated in the core -- the workaround demonstrates that WP has changed their rewrite logic.

  5. christopherlanger
    Member
    Posted 1 year ago #

    Same problem here. All my Permalinks are leading to 404s. Thanks for the hack, will try and play with that.

  6. bluantinoo
    Member
    Posted 1 year ago #

    Same problem here.
    The hack works great, but only on first level posts.
    on child posts I still get a 404

    I hope this can be fixed!

  7. fireproofsocks
    Member
    Plugin Author

    Posted 1 year ago #

    It's in the bug-tracker -- I just need a paying gig so this can get on my radar.

  8. bluantinoo
    Member
    Posted 1 year ago #

    Hi fireproofsocks

    just made a donation, I'm a big fan of your CCPM!

    is this below the bug we are talking about?
    https://code.google.com/p/wordpress-custom-content-type-manager/issues/detail?id=534

  9. fireproofsocks
    Member
    Plugin Author

    Posted 1 year ago #

  10. bluantinoo
    Member
    Posted 1 year ago #

    I had actually found the tracker, I was asking if the bug I linked is the very one we are talking about here.
    I want to be able to keep an eye on it :)

  11. LenMatts
    Member
    Posted 1 year ago #

    Thanks Mike for the wonderful solution..works perfectly! :)

    Kudos to FPS for the wonderful plugin!

  12. msartori
    Member
    Posted 1 year ago #

    Bluantinoo - I'm not sure if you were ever able to figure this out but I had some (dumb) luck with a workaround for the permalinks of child pages. I figured I'd write a blog post about it... http://www.tunedevelopment.com/custom-content-type-manager-hierarchical-post-type-issue-workaround/

    Did you find a different solution?

  13. bluantinoo
    Member
    Posted 1 year ago #

    Hi msartori,
    actually I did not.

    I was lucky that in all installations where i used CCTM I never needed hyerarchical custom post types.

    the only website where I had hyerarchical CPT I needed child posts just for admin purposes and using Mike's solution fixed the parent posts... so this issue was not really harmful.

    I've read your post and I'm sure I will use your workaround if I'll need to build a hyerarchical CPT. When I'll do I'll surely post a feedback in this thread.

    I'm quite sorry that fireproofsocks does not have the time to fix this issue, because even if there are others super-awesome plugins for managing Custom post types (free or premium it's the same, I don't really bother spending some bucks if the tool saves my time), I still prefer CCTM because it's not invasive and can be coupled with a lot of other plugins or custom code.

    For example: I use very often CCTM to build custom post types but another one (Advanced Custom Fields) to manage custom fields. Never had a problem! All plugins should be granular, I hate the "all-in-one" trend of premium plugins!

  14. fireproofsocks
    Member
    Plugin Author

    Posted 1 year ago #

    I'm working on fixing this -- the WP architecture surrounding URLs is not easy to work with, unfortunately. Since the time commitment is considerable, I'm considering implementing this as part of a pro version of the CCTM.

  15. bluantinoo
    Member
    Posted 1 year ago #

    Thumbs UP for fireproofsocks! :)

  16. msartori
    Member
    Posted 1 year ago #

    1. bluantinoo - I'm glad you haven't run into anything that made you stop using CCTM.

    2. fireproofsocks - I'm excited to see what a paid version looks like...mostly in terms of support. I suppose you'd need commitments from people before you dedicated all of that time. Count me in.

  17. Plivius
    Member
    Posted 1 year ago #

    @fireproofsocks / Plugin Authors:

    1) First of all, excellent plugin! :-)

    2) After upgrading to WP3.8.1, I ran into the same problems described above.
    Interestingly though, downgrading CCTM to version v 0.9.7.6 solved the problem for me! The major changes since that version seem to be in the permalink rules (flush removed from global settings?), so perhaps that's a good place to start.

    In short: WP 3.8.1 + CCTM v0.9.7.6 seems to be a workaround.

  18. fireproofsocks
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for the info -- yeah, I think the problem is how and when the plugin rewrite rules are flushed. In 0.9.7.6, the rewrite rules were flushed more often.

    Another workaround that may work: change permalink settings globally, then change them back. In some tests, that has successfully regenerated permalink rules for the defined custom post types.

    I'm working hard on the next version with a lot of improvements for this and testability overall.

  19. KarlFox2014akaKLDKarl
    Member
    Posted 1 year ago #

    Hello, fireproofsocks.

    Would it be possible to use the above mentionend workaround directly in the .htaccess file?

    We experience serious speed issues when using the snippet directly in the functions.php but currently have to use it to finish a project.

    As I am not an .htaccess expert, could you give me a hint how to set this up?
    Many thanks for your help and the great plugin.

    Regards,

    Karl

  20. fireproofsocks
    Member
    Plugin Author

    Posted 1 year ago #

    I'm not an expert on .htaccess modifications either, unfortunately, but in theory yes you could make alterations there. It would be muddying up the setup, so I'm bristling at the thought of it. Ugly links would cause much cleaner execution here, but I know few people prioritize functionality over aesthetics. The only other thing I can say to try is changing your permalink settings, saving them, and then changing them back: this can cause the rules to be regenerated and in some cases, the posts will be "visible" to WP's radar after the rules are regenerated.

    I'm working on the new version of this that fixes this, and offers new flexibility for URLs.

  21. KarlFox2014akaKLDKarl
    Member
    Posted 1 year ago #

    Hi,
    thanks for the fast reply. We will try the .htaccess route because resetting the permalinks didn't bring any changes.

    Thanks.
    Regards,

    Karl

  22. aman725
    Member
    Posted 10 months ago #

    Hi,

    I am using Custom Content Type Manager plugin and creating custom post. When i am trying to use permalink in CCTM with %postname% but its throw error when i use URL like this: http://localhost/internshipbible/banks/goldman-sachs/ .If permalinks are off in CCTM then url works fine: http://localhost/internshipbible/?post_type=banks&p=199.

    My WordPress Version : 3.9.2
    CCTM Version: 0.9.7.13

    Please help me, I have to fix this issue urgent.

  23. fireproofsocks
    Member
    Plugin Author

    Posted 10 months ago #

    Although there may be some workarounds to WP's troublesome URL routing, the real fix is in development and can be tracked at this issue: https://code.google.com/p/wordpress-custom-content-type-manager/issues/detail?id=534

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Custom Content Type Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags