Automattic / gutenberg-ramp

Control conditions under which Gutenberg loads - either from your theme code or from a UI
https://wordpress.org/plugins/gutenberg-ramp/
76 stars 15 forks source link

Plugin Errors CPTs without REST support #42

Closed mikeselander closed 6 years ago

mikeselander commented 6 years ago

When loading this plugin using 'load' => 1, the plugin errors out edit screens for CPTs that don't have show_in_rest set to true. Gutenberg natively handles this use case just fine, but Ramp railroads over this default handling and incorrectly shows an error page of No route was found matching the URL and request method.

Ramp should not regress the behavior that exists in normal Gutenberg if loading the plugin using a default loading pattern that doesn't define specific CPTs to load.

To test this, include both Ramp for Gutenberg and HM Redirects on a site and set Gutenberg loading to 'load' => 1. Then, attempt to access the editing UI for Redirects and see the error. These CPTs neither have an editor nor have REST support and this is causing a complete failure on the edit screen.

Reference #32 for a similar patch.

brettshumaker commented 6 years ago

Confirming that #43 does fix this issue. Using ramp_for_gutenberg_load_gutenberg( [ 'load' => 1 ] ); or ramp_for_gutenberg_load_gutenberg(); both now work as expected for post types that Gutenberg is unable to edit.

I think this can be closed now. 👍

mattoperry commented 6 years ago

Thanks for verifying @brettshumaker ... closing.