• Resolved neand

    (@neand)


    Hello

    I use custom posts and taxonomies registered with your plugin.
    It works great on my staging server but not on my client server:
    whenever I try to save a post with the Gutenberg editor I get a no route found error (404).
    The taxonomies are also not listed up.
    Both posts and taxonomies have show_in_rest set as true.
    The only difference I can think between the two server is the php version (7.2.10 on my client server) and the mysql version (5.7.16).
    I don’t get any php error though.
    But is there any minimum mysql version required for your plugin to work…?
    REST itself seems to be working, and I don’t have this problem on non-custom posts so I don’t think it’s an htaccess problem either…

    Thank you for your help.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hi @neand

    No minimum MySQL version required for our plugin. The only minimum we require would be WP versions and PHP versions. Everything else on that front is up to WordPress core.

    Can you paste us the output from the “Tools” menu item under our CPTUI section, on the right hand side, for both the Post Types and then also Taxonomies tabs?

    I’d like to spot check the settings being registered for your content types.

    A bit odd that those URLs being used are returning 404 errors, but I’ve seen weirder too.

    Thread Starter neand

    (@neand)

    Hi @tw2113

    Here is what I have in the Tools menu for the posts:

    {"news":{"name":"news","label":"\u304a\u77e5\u3089\u305b","singular_label":"\u304a\u77e5\u3089\u305b","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","delete_with_user":"false","show_in_rest":"true","rest_base":"","rest_controller_class":"","has_archive":"true","has_archive_string":"","exclude_from_search":"false","capability_type":"post","hierarchical":"true","rewrite":"true","rewrite_slug":"","rewrite_withfront":"true","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":"","supports":["title","editor","thumbnail","excerpt","author"],"taxonomies":["news_cat"],"labels":{"all_items":"\u5168\u8a18\u4e8b\u3092\u95b2\u89a7","add_new":"\u65b0\u898f\u4f5c\u6210","menu_name":"","add_new_item":"","edit_item":"","new_item":"","view_item":"","view_items":"","search_items":"","not_found":"","not_found_in_trash":"","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":"","name_admin_bar":"","item_published":"","item_published_privately":"","item_reverted_to_draft":"","item_scheduled":"","item_updated":""},"custom_supports":""},"technews":{"name":"technews","label":"\u6280\u8853\u60c5\u5831","singular_label":"\u6280\u8853\u60c5\u5831","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","delete_with_user":"false","show_in_rest":"true","rest_base":"","rest_controller_class":"","has_archive":"true","has_archive_string":"","exclude_from_search":"false","capability_type":"","hierarchical":"true","rewrite":"false","rewrite_slug":"","rewrite_withfront":"false","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":"dashicons-admin-tools","supports":["title","editor","thumbnail","excerpt","author"],"taxonomies":["tech_cat"],"labels":{"all_items":"\u5168\u8a18\u4e8b\u3092\u95b2\u89a7","add_new":"\u65b0\u898f\u4f5c\u6210","menu_name":"","add_new_item":"","edit_item":"","new_item":"","view_item":"","view_items":"","search_items":"","not_found":"","not_found_in_trash":"","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":"","name_admin_bar":"","item_published":"","item_published_privately":"","item_reverted_to_draft":"","item_scheduled":"","item_updated":""},"custom_supports":""}}

    And for the taxonomies:

    {"news_cat":{"name":"news_cat","label":"\u30ab\u30c6\u30b4\u30ea\u30fc\uff08\u30cb\u30e5\u30fc\u30b9\uff09","singular_label":"\u30ab\u30c6\u30b4\u30ea\u30fc\uff08\u30cb\u30e5\u30fc\u30b9\uff09","description":"","public":"true","publicly_queryable":"true","hierarchical":"true","show_ui":"true","show_in_menu":"true","show_in_nav_menus":"true","query_var":"true","query_var_slug":"","rewrite":"true","rewrite_slug":"","rewrite_withfront":"1","rewrite_hierarchical":"0","show_admin_column":"false","show_in_rest":"true","show_in_quick_edit":"","rest_base":"","rest_controller_class":"","labels":{"menu_name":"","all_items":"","edit_item":"","view_item":"","update_item":"","add_new_item":"","new_item_name":"","parent_item":"","parent_item_colon":"","search_items":"","popular_items":"","separate_items_with_commas":"","add_or_remove_items":"","choose_from_most_used":"","not_found":"","no_terms":"","items_list_navigation":"","items_list":""},"meta_box_cb":"","object_types":["news"]},"tech_cat":{"name":"tech_cat","label":"\u696d\u754c","singular_label":"\u696d\u754c","description":"","public":"true","publicly_queryable":"true","hierarchical":"true","show_ui":"true","show_in_menu":"true","show_in_nav_menus":"true","query_var":"true","query_var_slug":"","rewrite":"true","rewrite_slug":"","rewrite_withfront":"1","rewrite_hierarchical":"0","show_admin_column":"false","show_in_rest":"true","show_tagcloud":"false","show_in_quick_edit":"","rest_base":"","rest_controller_class":"WP_REST_Terms_Controller","labels":{"menu_name":"","all_items":"","edit_item":"","view_item":"","update_item":"","add_new_item":"","new_item_name":"","parent_item":"","parent_item_colon":"","search_items":"","popular_items":"","separate_items_with_commas":"","add_or_remove_items":"","choose_from_most_used":"","not_found":"","no_terms":"","items_list_navigation":"","items_list":"","back_to_items":""},"meta_box_cb":"","default_term":"","object_types":["technews"]}}

    (sorry for all the unicode names)

    POST to wp-json/wp/v2/posts/300?_locale=user work fine, but
    GET to wp-json/wp/v2/news_cat, or POST to wp-json/wp/v2/news/200?_locale=user don’t…

    Thank you for your help!

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Curious if there’s other things in your install that are hampering this.

    I imported your post type and taxonomy, created a post, created a news term, and assigned the term to that post.

    When I visit this url: /wp-json/wp/v2/news, I’m seeing the following:

    https://cloudup.com/cJkX-lZ9P1f

    Then when I visit the taxonomy endpoint at /wp-json/wp/v2/news_cat, I’m seeing similar about the taxonomy/term in question.

    https://cloudup.com/cziC1gVLzJL

    Is it possible you maybe had these same content types registered elsewhere before trying with CPTUI, and those settings are maybe getting used still? Post types and taxonomies are registered on the fly, and whichever version gets registered last, is the one used

    Thread Starter neand

    (@neand)

    I finally found the culprit, I noticed that /wp-json/wp/v2/taxonomies was working but did not list the taxonomies registered with CPTUI. I finally found that this was caused by a small function in the mu-plugin directory which disactivated some plugins under certain conditions, including CPTUI…
    Thank you very much for your help!

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Glad to hear you tracked things down.

    Let us know if anything else comes up.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘no route when saving custom posts’ is closed to new replies.