[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
Tue Oct 24 15:40:29 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:                   |     Focuses:
-----------------------------+---------------------

Comment (by hellofromTonya):

 [https://wordpress.slack.com/archives/C055Y7FKS7N/p1698158278612709?thread_ts=1697743553.695489&cid=C055Y7FKS7N
 Sharing what I shared in the Make/Core slack channel] about Option 1:

 >Could Core not load its class files and/or functions that will be
 incompatible with different versions of Gutenberg that have the same named
 classes and/or functions?

 Core is loaded by default. It does not guard itself to protect against
 naming collisions outside of Core. Why? Its files are loaded into memory
 ''very very early'' in the boot up process before plugins and themes.

 Not loading Core class files or functions if the Gutenberg plugin version
 is incompatible likely will require:

 * Waiting until later in the boot up cycle to load files that have naming
 conflicts with known older versions of Gutenberg.

 This is risky. Why? Other code (such as within Core itself) may depend
 upon these classes/functions being loaded into memory. Identifying each of
 these is risky this late in the release cycle. This would be better done
 `early` in alpha IMO.

 * Need a list of which Gutenberg versions are incompatible for each PHP
 file or function.
 * Add guards to either not load the class file or function if incompatible
 with Gutenberg version.
 * Is Gutenberg activated? Is it an incompatible version? For Core to load
 these files/functions, it would need to look ahead (as waiting until
 Gutenberg is loaded might be too late):
    * Look ahead to to determine (a) is it activated and (b) get the
 version number from file's header.

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


More information about the wp-trac mailing list