Support » Plugin: Custom Content Type Manager » Custom Content Type 404 after 3.7 Upgrade

Viewing 15 replies - 1 through 15 (of 27 total)
  • Plugin Contributor fireproofsocks

    (@fireproofsocks)

    Any errors in your logs? If you turn off permalinks for the site, do the pages render? If you try to view a post in the education section, can you view it under any circumstances?

    We are having the same problem with CCT posts.
    Is this a plugin issue?

    Here is the error log:
    [Wed Oct 30 12:26:08 2013] [error] [client 98.217.192.97] PHP Warning: Invalid argument supplied for foreach() in /nas/wp/www/cluster-1033/[sitename]/wp-content/themes/[sitename]/child-of-category-staff.php on line 64
    [Wed Oct 30 12:26:16 2013] [error] [client 98.217.192.97] PHP Warning: Invalid argument supplied for foreach() in /nas/wp/www/cluster-1033/[sitename]/wp-content/themes/[sitename]/child-of-category-staff.php on line 64
    [Wed Oct 30 12:26:18 2013] [error] [client 98.217.192.97] PHP Warning: Invalid argument supplied for foreach() in /nas/wp/www/cluster-1033/[sitename]/wp-content/themes/[sitename]/child-of-category-staff.php on line 64
    [Wed Oct 30 12:26:19 2013] [error] [client 98.217.192.97] PHP Warning: Invalid argument supplied for foreach() in /nas/wp/www/cluster-1033/[sitename]/wp-content/themes/[sitename]/child-of-category-staff.php on line 64
    [Wed Oct 30 12:26:20 2013] [error] [client 98.217.192.97] PHP Warning: Invalid argument supplied for foreach() in /nas/wp/www/cluster-1033/[sitename]/wp-content/themes/[sitename]/child-of-category-staff.php on line 64[sitename]

    We ticked the Categories option in this screenshot and that resolved the problem. @fireproofsocks, can you please explain why this is necessary now (and wasn’t before)? Is this related to 3.7?
    Screenshot: http://note.io/HeXn8g
    Thanks!
    -Josh

    Plugin Contributor fireproofsocks

    (@fireproofsocks)

    Good question — I can’t be entirely sure what’s causing that without seeing the theme’s code. My best guess is that PHP code in the theme isn’t checking whether categories exist before trying to loop over them– WordPress themes and plugins have a staggering amount of shoddy code in them, and the most common errors are 1) not checking whether an array key exists (isset) and 2) not verifying the data type (is_array in this case) . By checking the “Categories” option in the CCTM’s post-definition, you’re setting that node of the array to contain an empty array, the byproduct of which is that the theme’s code never encounters an error condition.

    I’m not convinced this has anything to with 3.7 or with the OP’s issue, however…

    Hello,

    I am having the same problem.
    However, Josh’s solution didn’t work.

    I have nothing in my log file.

    All I know is that it doesn’t work since I updated to WP 3.7.1
    And it was working before on WP 3.7.0

    if it can help, here is an example of the content type.

    (I activated every debug/error display I could to help me out, but so far nothing…)

    do you have any other great guess that might help? 🙂

    Plugin Contributor fireproofsocks

    (@fireproofsocks)

    did you set WP_DEBUG to true in your wp-config.php?

    More helpful here would be including your cctm.json definition file — that’s the only way to share your post-type.

    yes, WP_DEBUG is at true.
    here is my cctm.json file:

    {"export_info":{"title":"CCTM Site","author":"aurelien/AT/verbalpixel.com","url":"http:\/\/bve.humaneos.net","template_url":"","description":"This site was created in part using the Custom Content Type Manager","_timestamp_export":1383243504,"_source_site":"http:\/\/bve.humaneos.net","_charset":"UTF-8","_language":"en-US","_wp_version":"3.7.1","_cctm_version":"0.9.7.11-pl"},"post_type_defs":{"expeditions":{"cctm_hierarchical_custom":"","cctm_hierarchical_includes_drafts":"","cctm_hierarchical_post_types":["expeditions"],"cctm_custom_columns_enabled":0,"supports":["title","editor","page-attributes","thumbnail"],"taxonomies":["category","post_tag"],"post_type":"expeditions","labels":{"menu_name":"Exp\u00e9ditions","singular_name":"Expeditions","add_new":"Add New","add_new_item":"Add New Expeditions","edit_item":"Edit Expeditions","new_item":"New Expeditions","view_item":"View Expeditions","search_items":"Search Exp\u00e9ditions","not_found":"No exp\u00e9ditions found","not_found_in_trash":"No exp\u00e9ditions found in trash","parent_item_colon":"Parent Page"},"description":"Liste des exp\u00e9ditions de Bernard","menu_icon":"\/wp-content\/plugins\/custom-content-type-manager\/images\/icons\/16x16\/aim_protocol.png","label":"Expeditions","cctm_show_in_menu":"1","cctm_show_in_menu_custom":"","show_in_admin_bar":true,"menu_position":null,"rewrite_with_front":true,"permalink_action":"\/%postname%\/","rewrite_slug":"\/explorateur\/expeditions","query_var":false,"public":true,"show_ui":true,"show_in_nav_menus":true,"publicly_queryable":true,"include_in_search":true,"include_in_rss":true,"capability_type":"post","capabilities":"","register_meta_box_cb":"","can_export":true,"cctm_enable_right_now":"1","custom_orderby":"","custom_order":"ASC","use_default_menu_icon":false,"hierarchical":true,"map_meta_cap":false,"has_archive":false,"show_in_menu":"","rewrite":true,"is_active":1,"custom_fields":["sousparties"],"original_post_type_name":"expeditions"},"citations":{"cctm_hierarchical_custom":"","cctm_hierarchical_includes_drafts":"","cctm_hierarchical_post_types":[],"cctm_custom_columns_enabled":0,"supports":["title"],"taxonomies":[],"post_type":"citations","labels":{"menu_name":"T\u00e9moignages","singular_name":"Citations","add_new":"Add New","add_new_item":"Add New Citations","edit_item":"Edit Citations","new_item":"New Citations","view_item":"View Citations","search_items":"Search Citations","not_found":"No citations found","not_found_in_trash":"No citations found in trash","parent_item_colon":"Parent Page"},"description":"Citations ou t\u00e9moignages affich\u00e9s dans les onglets des conf\u00e9rences","menu_icon":"\/wp-content\/plugins\/custom-content-type-manager\/images\/icons\/16x16\/chat.png","label":"Citations","cctm_show_in_menu":"1","cctm_show_in_menu_custom":"","show_in_admin_bar":true,"menu_position":null,"rewrite_with_front":true,"permalink_action":"Off","rewrite_slug":"","query_var":false,"public":true,"show_ui":true,"show_in_nav_menus":true,"publicly_queryable":true,"include_in_search":true,"include_in_rss":true,"capability_type":"post","capabilities":"","register_meta_box_cb":"","can_export":true,"cctm_enable_right_now":"1","custom_orderby":"","custom_order":"ASC","use_default_menu_icon":false,"hierarchical":false,"map_meta_cap":false,"has_archive":false,"show_in_menu":"","rewrite":false,"is_active":1,"custom_fields":["quote"],"original_post_type_name":"citations"},"post":{"custom_fields":[]},"page":{"custom_fields":[]},"acf":{"custom_fields":[]},"wpcf7_contact_form":{"custom_fields":[]},"cycloneslider":{"custom_fields":[]},"conferences":{"cctm_hierarchical_custom":"","cctm_hierarchical_includes_drafts":"","cctm_hierarchical_post_types":[],"cctm_custom_columns_enabled":0,"supports":["title","editor","page-attributes","thumbnail"],"taxonomies":[],"post_type":"conferences","labels":{"menu_name":"Conf\u00e9rences","singular_name":"Conferences","add_new":"Add New","add_new_item":"Add New Conferences","edit_item":"Edit Conferences","new_item":"New Conferences","view_item":"View Conferences","search_items":"Search Conf\u00e9rences","not_found":"No conf\u00e9rences found","not_found_in_trash":"No conf\u00e9rences found in trash","parent_item_colon":"Parent Page"},"description":"","menu_icon":"\/wp-content\/plugins\/custom-content-type-manager\/images\/icons\/16x16\/agt_forum.png","label":"Conferences","cctm_show_in_menu":"1","cctm_show_in_menu_custom":"","show_in_admin_bar":true,"menu_position":null,"rewrite_with_front":true,"permalink_action":"Custom","rewrite_slug":"\/conferencier","query_var":false,"public":true,"show_ui":true,"show_in_nav_menus":true,"publicly_queryable":true,"include_in_search":true,"include_in_rss":true,"capability_type":"post","capabilities":"","register_meta_box_cb":"","can_export":true,"cctm_enable_right_now":"1","custom_orderby":"","custom_order":"ASC","use_default_menu_icon":false,"hierarchical":true,"map_meta_cap":false,"has_archive":false,"show_in_menu":"","rewrite":{"slug":"\/conferencier","with_front":true},"is_active":1,"custom_fields":["subtitle","sousparties"],"original_post_type_name":"conferences","map_field_metabox":{"subtitle":"cctm_default","sousparties":"cctm_default"}},"long_road":{"cctm_hierarchical_custom":"","cctm_hierarchical_includes_drafts":"","cctm_hierarchical_post_types":[],"cctm_custom_columns_enabled":0,"supports":["title","editor","page-attributes","thumbnail"],"taxonomies":["category"],"post_type":"long_road","labels":{"menu_name":"Une Longue route","singular_name":"Long_road","add_new":"Add New","add_new_item":"Add New Long_road","edit_item":"Edit Long_road","new_item":"New Long_road","view_item":"View Long_road","search_items":"Search Une Longue route","not_found":"No une longue route found","not_found_in_trash":"No une longue route found in trash","parent_item_colon":"Parent Page"},"description":"","use_default_menu_icon":false,"label":"Long_road","cctm_show_in_menu":"1","cctm_show_in_menu_custom":"","show_in_admin_bar":true,"menu_position":null,"rewrite_with_front":true,"permalink_action":"Off","rewrite_slug":"","query_var":false,"public":true,"show_ui":true,"show_in_nav_menus":true,"publicly_queryable":true,"include_in_search":true,"include_in_rss":true,"capability_type":"post","capabilities":"","register_meta_box_cb":"","can_export":true,"cctm_enable_right_now":"1","custom_orderby":"","custom_order":"ASC","hierarchical":true,"map_meta_cap":false,"has_archive":false,"show_in_menu":"","rewrite":false,"is_active":1,"menu_icon":"\/wp-content\/plugins\/custom-content-type-manager\/images\/icons\/16x16\/goto.png","original_post_type_name":"long_road"},"disctinctions":{"cctm_hierarchical_custom":"","cctm_hierarchical_includes_drafts":"","cctm_hierarchical_post_types":[],"cctm_custom_columns_enabled":0,"supports":["title","editor","page-attributes","thumbnail"],"taxonomies":[],"post_type":"disctinctions","labels":{"menu_name":"Prix et disctinctions","singular_name":"Disctinctions","add_new":"Add New","add_new_item":"Add New Disctinctions","edit_item":"Edit Disctinctions","new_item":"New Disctinctions","view_item":"View Disctinctions","search_items":"Search Prix et disctinctions","not_found":"No prix et disctinctions found","not_found_in_trash":"No prix et disctinctions found in trash","parent_item_colon":"Parent Page"},"description":"","menu_icon":"\/wp-content\/plugins\/custom-content-type-manager\/images\/icons\/16x16\/bookmark.png","label":"Long_road","hierarchical":true,"cctm_show_in_menu":"1","cctm_show_in_menu_custom":"","show_in_admin_bar":true,"menu_position":null,"rewrite_with_front":true,"permalink_action":"Off","rewrite_slug":"","query_var":false,"public":true,"show_ui":true,"show_in_nav_menus":true,"publicly_queryable":true,"include_in_search":true,"include_in_rss":true,"capability_type":"post","capabilities":"","register_meta_box_cb":"","can_export":true,"cctm_enable_right_now":"1","custom_order":"ASC","use_default_menu_icon":false,"map_meta_cap":false,"has_archive":false,"show_in_menu":"","rewrite":false,"custom_fields":[],"is_active":1,"custom_orderby":"","original_post_type_name":"disctinctions"}},"custom_field_defs":{"sousparties":{"continue_editing":"0","label":"sous-parties","name":"sousparties","default_value":"","extra":"cols=\"80\" rows=\"10\"","class":"","description":"","validator":"","output_filter":"do_shortcode","type":"wysiwyg","hide_from_templates":""},"quote":{"continue_editing":"0","label":"Citations \/ t\u00e9moignage","name":"quote","default_value":"","extra":"size=\"500\"","class":"","description":"Taille maximum recommand\u00e9e: 244 caract\u00e8res (environ 40mots)\r\navec une taille maximum pour le titre: 112 caract\u00e8res (16 mots)\r\n\r\nNote: Caract\u00e8res avec espaces","required":"1","validator":"","output_filter":"","type":"textarea","hide_from_templates":""},"subtitle":{"continue_editing":"1","label":"Sous-titre","name":"subtitle","default_value":" ","extra":"","class":"","description":"","validator":"","output_filter":"","type":"text","hide_from_templates":""}}}

    hope it helps..

    Turning off Hierarchical under page attributes solves the problem with 404s in our case. @fireproofsocks, @_oreo

    Plugin Contributor fireproofsocks

    (@fireproofsocks)

    Interesting. I’ll have to confirm, but it sounds like some of the WP internals changed re URL routing, so the CCTM actions/hooks need to be updated.

    I also have the same issue. If Hierarchical is turned on with “Rewrite with Permalink Front checked” and Permalink action = /%postname%/, I get a 404 on single post of my custom type. If I turn off Hierarchical or switch “Rewrite with Permalink Front” to off, the single post pages display. I’m on 3.7.1

    it does work, thanks a lot.
    However, I do need Hierarchical needs to be ON in my case…

    I guess, the solution for now should be to created a content type for every hierarchy level. (@bridgetwes, I hope you don’t have a lot of them!)
    what do you think?

    Plugin Contributor fireproofsocks

    (@fireproofsocks)

    Creating a content type for each level of the hierarchy is not a good solution (in my opinion): that’s corrupting the data model to compensate for WP’s inability to handle custom URL structures.

    Sorry for the delay.
    ok, then, so I guess we should not use Hierarchical with Permalink Action for now.
    BTW, thanks a lot for this plugin, fireproofsocks! you are doing a excellent job!

    Hi There,

    I’m having the same issue too and i have always turned on the category but still the permalink is still not working and this is the error i’ve got from my log.

    urldecode() expects parameter 1 to be string, array given in wp-includes/query.php

    It seems that new version of wordpress have change their way of scripting.

    Thanks guys. at least i know i’m not the only one having this issue

Viewing 15 replies - 1 through 15 (of 27 total)
  • The topic ‘Custom Content Type 404 after 3.7 Upgrade’ is closed to new replies.