[wp-trac] [WordPress Trac] #59718: Short-term (WP 6.4) hotfix to prevent fatal error in standalone Gutenberg (<16.5)

WordPress Trac noreply at wordpress.org
Wed Oct 25 09:40:02 UTC 2023


#59718: Short-term (WP 6.4) hotfix to prevent fatal error in standalone Gutenberg
(<16.5)
-----------------------------------------------+---------------------
 Reporter:  rebasaurus                         |       Owner:  (none)
     Type:  defect (bug)                       |      Status:  new
 Priority:  normal                             |   Milestone:  6.4
Component:  Upgrade/Install                    |     Version:
 Severity:  critical                           |  Resolution:
 Keywords:  reporter-feedback close has-patch  |     Focuses:
-----------------------------------------------+---------------------

Comment (by ramonopoly):

 Hi folks!

 If I recall correctly, changing the access on the
 [https://github.com/WordPress/wordpress-
 develop/blob/f7d73158acd8bef9c0d98316c1cd5ecf4cd1a636/src/wp-includes
 /rest-api/endpoints/class-wp-rest-global-styles-controller.php#L698
 validate_custom_css] method was done to make it consistent with other REST
 API classes, namely, so that any classes that extend them will have access
 to these methods internally.

 Gutenberg itself has a
 [https://github.com/WordPress/gutenberg/blob/trunk/gutenberg.php#L6
 minimum requirement of WordPress 6.2], which is why the
 `Gutenberg_REST_Global_Styles_Controller_6_2` classes and other 6.2
 compatibility-specific code was removed from the plugin.

 WordPress 6.4 ''should'' contain all the non-experimental functionality of
 Gutenberg 16.8, so running a previous version such as 16.5, I believe,
 aside from the bespoke control workflows mentioned, has little pragmatic
 benefit.

 It's a tough one: reverting `validate_custom_css` access back to "private"
 works yes, but in my mind it would be undesirable due to the extensibility
 issue mentioned above.

 There are, however, understandable backwards compatibility concerns as
 this ticket explains.

 If folks think reverting is acceptable, the main thing I'd be worried
 about is whether plugins etc are extending
 WP_REST_Global_Styles_Controller with the expectation of having access to
 this method. Given that the change was in 6.4 its seems that it's
 unlikely. A quick search confirms this:
 https://wpdirectory.net/search/01HDK32TW3W7NGTCBPMRZ2RVEY

 The following PR, when merged, seems like it would help prevent such
 situations in the future (?)

 https://github.com/WordPress/gutenberg/pull/35194

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59718#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list